Made unlocked blocks in campaign reflect host research
This commit is contained in:
@@ -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(){
|
public boolean unlockedNowHost(){
|
||||||
if(!state.isCampaign()) return true;
|
if(!state.isCampaign()) return true;
|
||||||
return net != null && net.client() ?
|
return net != null && net.client() ?
|
||||||
|
|||||||
@@ -1728,7 +1728,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean canRepairDerelict(Tile tile){
|
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);
|
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){
|
boolean unlocked(Block block){
|
||||||
return block.unlockedNow() && block.placeablePlayer && block.environmentBuildable() &&
|
return block.unlockedNowHost() && block.placeablePlayer && block.environmentBuildable() &&
|
||||||
block.supportsEnv(state.rules.env); //TODO this hides env unsupported blocks, not always a good thing
|
block.supportsEnv(state.rules.env);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasInfoBox(){
|
boolean hasInfoBox(){
|
||||||
|
|||||||
@@ -285,6 +285,8 @@ public class UnitFactory extends UnitBlock{
|
|||||||
|
|
||||||
rebuildCommands.run();
|
rebuildCommands.run();
|
||||||
|
|
||||||
|
//Since the menu gets hidden when a new unit is selected, this is unnecessary.
|
||||||
|
/*
|
||||||
UnitType[] lastUnit = {unit()};
|
UnitType[] lastUnit = {unit()};
|
||||||
|
|
||||||
commands.update(() -> {
|
commands.update(() -> {
|
||||||
@@ -292,7 +294,7 @@ public class UnitFactory extends UnitBlock{
|
|||||||
lastUnit[0] = unit();
|
lastUnit[0] = unit();
|
||||||
rebuildCommands.run();
|
rebuildCommands.run();
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user