mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-31 01:44:22 +07:00
Made unlocked blocks in campaign reflect host research
This commit is contained in:
parent
a7c3ce5d8c
commit
e2019fd5dc
@ -222,6 +222,7 @@ public abstract class UnlockableContent extends MappableContent{
|
||||
}
|
||||
}
|
||||
|
||||
/** @return in multiplayer, whether this is unlocked for the host player, otherwise, whether it is unlocked for the local player (same as unlocked()) */
|
||||
public boolean unlockedNowHost(){
|
||||
if(!state.isCampaign()) return true;
|
||||
return net != null && net.client() ?
|
||||
|
@ -1728,7 +1728,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
boolean canRepairDerelict(Tile tile){
|
||||
return tile != null && tile.build != null && !state.rules.editor && player.team() != Team.derelict && tile.build.team == Team.derelict && tile.build.block.unlockedNow() &&
|
||||
return tile != null && tile.build != null && !state.rules.editor && player.team() != Team.derelict && tile.build.team == Team.derelict && tile.build.block.unlockedNowHost() &&
|
||||
Build.validPlace(tile.block(), player.team(), tile.build.tileX(), tile.build.tileY(), tile.build.rotation);
|
||||
}
|
||||
|
||||
|
@ -739,8 +739,8 @@ public class PlacementFragment{
|
||||
}
|
||||
|
||||
boolean unlocked(Block block){
|
||||
return block.unlockedNow() && block.placeablePlayer && block.environmentBuildable() &&
|
||||
block.supportsEnv(state.rules.env); //TODO this hides env unsupported blocks, not always a good thing
|
||||
return block.unlockedNowHost() && block.placeablePlayer && block.environmentBuildable() &&
|
||||
block.supportsEnv(state.rules.env);
|
||||
}
|
||||
|
||||
boolean hasInfoBox(){
|
||||
|
@ -285,6 +285,8 @@ public class UnitFactory extends UnitBlock{
|
||||
|
||||
rebuildCommands.run();
|
||||
|
||||
//Since the menu gets hidden when a new unit is selected, this is unnecessary.
|
||||
/*
|
||||
UnitType[] lastUnit = {unit()};
|
||||
|
||||
commands.update(() -> {
|
||||
@ -292,7 +294,7 @@ public class UnitFactory extends UnitBlock{
|
||||
lastUnit[0] = unit();
|
||||
rebuildCommands.run();
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
table.row();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user