Allow all floors to replace each other
This commit is contained in:
@@ -195,7 +195,7 @@ public class Build{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!type.requiresWater && !contactsShallows(tile.x, tile.y, type) && !type.placeableLiquid){
|
if(!type.requiresWater && !type.isFloor() && !contactsShallows(tile.x, tile.y, type) && !type.placeableLiquid){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ public class Build{
|
|||||||
(check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water
|
(check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water
|
||||||
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate && !((type == check.block && check.team() == Team.derelict))) || //same block, same rotation
|
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate && !((type == check.block && check.team() == Team.derelict))) || //same block, same rotation
|
||||||
!check.interactable(team) || //cannot interact
|
!check.interactable(team) || //cannot interact
|
||||||
!check.floor().placeableOn || //solid wall
|
(!check.floor().placeableOn && !type.isFloor()) || //solid floor
|
||||||
(!checkVisible && !check.block().alwaysReplace) || //replacing a block that should be replaced (e.g. payload placement)
|
(!checkVisible && !check.block().alwaysReplace) || //replacing a block that should be replaced (e.g. payload placement)
|
||||||
!(((type.canReplace(check.block()) || (type == check.block && state.rules.derelictRepair && check.team() == Team.derelict)) || //can replace type OR can replace derelict block of same type
|
!(((type.canReplace(check.block()) || (type == check.block && state.rules.derelictRepair && check.team() == Team.derelict)) || //can replace type OR can replace derelict block of same type
|
||||||
(check.build instanceof ConstructBuild build && build.current == type && check.centerX() == tile.x && check.centerY() == tile.y)) && //same type in construction
|
(check.build instanceof ConstructBuild build && build.current == type && check.centerX() == tile.x && check.centerY() == tile.y)) && //same type in construction
|
||||||
|
|||||||
@@ -83,13 +83,13 @@ public class Floor extends Block{
|
|||||||
protected TextureRegion edgeRegion;
|
protected TextureRegion edgeRegion;
|
||||||
|
|
||||||
public Floor(String name){
|
public Floor(String name){
|
||||||
super(name);
|
this(name, 3);
|
||||||
variants = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Floor(String name, int variants){
|
public Floor(String name, int variants){
|
||||||
super(name);
|
super(name);
|
||||||
this.variants = variants;
|
this.variants = variants;
|
||||||
|
placeableLiquid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user