Spawn on core doesnt ignore "possessionAllowed" rule (#12183)

* Make player cannot control building when possession disabled

* check is core best
This commit is contained in:
2B2M22
2026-07-03 20:36:08 -04:00
committed by GitHub
parent 6a6ed90473
commit c2103247ed
+1 -1
View File
@@ -743,7 +743,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(player == null || build == null || player.dead()) return;
//make sure player is allowed to control the building
if(net.server() && !netServer.admins.allowAction(player, ActionType.buildSelect, action -> action.tile = build.tile)){
if(net.server() && (!state.rules.possessionAllowed && player.bestCore() != build || !netServer.admins.allowAction(player, ActionType.buildSelect, action -> action.tile = build.tile))){
throw new ValidateException(player, "Player cannot control a building.");
}