Address issue #1271

This commit is contained in:
TheComputerGeek2 2018-04-22 15:55:42 -07:00 committed by Magnus Ulf Jørgensen
parent 5fad79b026
commit 6635ec9710
1 changed files with 4 additions and 0 deletions

View File

@ -354,6 +354,8 @@ public class EnginePermBuild extends Engine
PS toPs = PS.valueOf(chunkToX, chunkToZ);
TerritoryAccess fromTa = map.get(fromPs);
TerritoryAccess toTa = map.get(toPs);
// Null checks are needed here since automatic board cleaning can be undesired sometimes
String fromId = fromTa != null ? fromTa.getHostFactionId() : Factions.ID_NONE;
String toId = toTa != null ? toTa.getHostFactionId() : Factions.ID_NONE;
@ -362,7 +364,9 @@ public class EnginePermBuild extends Engine
// ... and the faction "from" can not build at "to" ...
Faction fromFac = FactionColl.get().getFixed(fromId);
if (fromFac == null) fromFac = FactionColl.get().getNone();
Faction toFac = FactionColl.get().getFixed(toId);
if (toFac == null) toFac = FactionColl.get().getNone();
if (MPerm.getPermBuild().has(fromFac, toFac)) return;
// ... cancel the event!