CastleAmbassador check for existing fortress.
This commit is contained in:
		| @@ -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(); | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment