Castle NPE check for isAutoAttackable first mid victory.
This commit is contained in:
parent
5838543afb
commit
5d43fcd6b4
@ -8276,7 +8276,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8279,7 +8279,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8281,7 +8281,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8276,7 +8276,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8292,7 +8292,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8292,7 +8292,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8293,7 +8293,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8308,7 +8308,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8410,7 +8410,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8436,7 +8436,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8473,7 +8473,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8489,7 +8489,9 @@ public class Player extends Playable
|
||||
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
|
||||
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
|
||||
{
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8373,7 +8373,9 @@ public class Player extends Playable
|
||||
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
|
||||
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
|
||||
{
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8184,7 +8184,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8184,7 +8184,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8170,7 +8170,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8197,7 +8197,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8197,7 +8197,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8151,7 +8151,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8162,7 +8162,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8303,7 +8303,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8369,7 +8369,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,10 +73,10 @@ import org.l2jmobius.gameserver.data.xml.AttendanceRewardData;
|
||||
import org.l2jmobius.gameserver.data.xml.CategoryData;
|
||||
import org.l2jmobius.gameserver.data.xml.ClassListData;
|
||||
import org.l2jmobius.gameserver.data.xml.CollectionData;
|
||||
import org.l2jmobius.gameserver.data.xml.HennaPatternPotentialData;
|
||||
import org.l2jmobius.gameserver.data.xml.ElementalSpiritData;
|
||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.data.xml.HennaData;
|
||||
import org.l2jmobius.gameserver.data.xml.HennaPatternPotentialData;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcNameLocalisationData;
|
||||
import org.l2jmobius.gameserver.data.xml.OptionData;
|
||||
@ -8482,7 +8482,8 @@ public class Player extends Playable
|
||||
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
|
||||
{
|
||||
// If first mid victory is achieved, attackers can attack attackers.
|
||||
return CastleManager.getInstance().getCastleById(_siegeSide).isFirstMidVictory();
|
||||
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
|
||||
return (castle != null) && castle.isFirstMidVictory();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user