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