CastleAmbassador check for existing fortress.
This commit is contained in:
parent
9f626229a9
commit
9fd5a862d1
@ -156,8 +156,9 @@ public class CastleAmbassador extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onSpawn(Npc npc)
|
public String onSpawn(Npc npc)
|
||||||
{
|
{
|
||||||
final Castle castle = npc.getFort().getCastleByAmbassador(npc.getId());
|
final Fort fort = npc.getFort();
|
||||||
if (castle.getOwnerId() == 0)
|
final Castle castle = fort == null ? null : fort.getCastleByAmbassador(npc.getId());
|
||||||
|
if ((castle == null) || (castle.getOwnerId() == 0))
|
||||||
{
|
{
|
||||||
npc.deleteMe();
|
npc.deleteMe();
|
||||||
}
|
}
|
||||||
|
@ -156,8 +156,9 @@ public class CastleAmbassador extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onSpawn(Npc npc)
|
public String onSpawn(Npc npc)
|
||||||
{
|
{
|
||||||
final Castle castle = npc.getFort().getCastleByAmbassador(npc.getId());
|
final Fort fort = npc.getFort();
|
||||||
if (castle.getOwnerId() == 0)
|
final Castle castle = fort == null ? null : fort.getCastleByAmbassador(npc.getId());
|
||||||
|
if ((castle == null) || (castle.getOwnerId() == 0))
|
||||||
{
|
{
|
||||||
npc.deleteMe();
|
npc.deleteMe();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user