Avoid NPE

This commit is contained in:
Magnus Ulf 2019-02-10 19:06:00 +01:00
parent c0a6e0481c
commit b5cade3793
2 changed files with 7 additions and 3 deletions

View File

@ -110,8 +110,11 @@ public class EngineCanCombatHappen extends Engine
Faction defenderPsFaction = BoardColl.get().getFactionAt(defenderPs); Faction defenderPsFaction = BoardColl.get().getFactionAt(defenderPs);
// ... fast evaluate if the attacker is overriding ... // ... fast evaluate if the attacker is overriding ...
if (MUtil.isPlayer(eattacker))
{
MPlayer mplayer = MPlayer.get(eattacker); MPlayer mplayer = MPlayer.get(eattacker);
if (mplayer != null && mplayer.isOverriding()) return true; if (mplayer != null && mplayer.isOverriding()) return true;
}
// ... PVP flag may cause a damage block ... // ... PVP flag may cause a damage block ...
if (defenderPsFaction.getFlag(MFlag.getFlagPvp()) == false) if (defenderPsFaction.getFlag(MFlag.getFlagPvp()) == false)

View File

@ -43,7 +43,8 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
// META // META
// -------------------------------------------- // // -------------------------------------------- //
public static MPlayer get(Object oid) { public static MPlayer get(Object oid)
{
return MPlayerColl.get().get(oid); return MPlayerColl.get().get(oid);
} }