Exclude non playables from isSiegeFriend mid victory check.

This commit is contained in:
MobiusDevelopment
2022-04-05 21:53:49 +00:00
parent b62ccc548a
commit 02597f65af
25 changed files with 50 additions and 50 deletions

View File

@ -1687,13 +1687,13 @@ public class Player extends Playable
// Check first castle mid victory.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
if ((castle != null) && !castle.isFirstMidVictory())
final Player targetPlayer = target.getActingPlayer();
if ((castle != null) && (targetPlayer != null) && !castle.isFirstMidVictory())
{
return true;
}
// If target isn't a player, is self, isn't on same siege or not on same state, not friends.
final Player targetPlayer = target.getActingPlayer();
if ((targetPlayer == null) || (targetPlayer == this) || (targetPlayer.getSiegeSide() != _siegeSide) || (_siegeState != targetPlayer.getSiegeState()))
{
return false;