Fixed probable Player getPlayerSide NPE.

This commit is contained in:
MobiusDevelopment
2022-04-07 18:58:20 +00:00
parent 48c6ffce5c
commit 2897ec40a8
23 changed files with 345 additions and 46 deletions
@@ -13584,11 +13584,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13587,11 +13587,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13590,11 +13590,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13562,11 +13562,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13588,11 +13588,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13591,11 +13591,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13597,11 +13597,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13633,11 +13633,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13749,11 +13749,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13787,11 +13787,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13849,11 +13849,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13849,11 +13849,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13401,11 +13401,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13401,11 +13401,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13387,11 +13387,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13435,11 +13435,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13435,11 +13435,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13445,11 +13445,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13397,11 +13397,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13716,11 +13716,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13794,11 +13794,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13916,11 +13916,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**
@@ -13916,11 +13916,24 @@ public class Player extends Playable
*/ */
public CastleSide getPlayerSide() public CastleSide getPlayerSide()
{ {
if ((_clan == null) || (_clan.getCastleId() == 0)) if (_clan == null)
{ {
return CastleSide.NEUTRAL; return CastleSide.NEUTRAL;
} }
return CastleManager.getInstance().getCastleById(getClan().getCastleId()).getSide();
final int castleId = _clan.getCastleId();
if (castleId == 0)
{
return CastleSide.NEUTRAL;
}
final Castle castle = CastleManager.getInstance().getCastleById(castleId);
if (castle == null)
{
return CastleSide.NEUTRAL;
}
return castle.getSide();
} }
/** /**