Bootleg fix for NPC aggro crash

This commit is contained in:
dginovker
2020-09-04 08:57:03 -04:00
parent 9011688d2a
commit fd0bfda8a7
@@ -20,6 +20,7 @@ public class NpcAggressive {
};
public static boolean isAggressive(int i) {
try {
boolean aggressive = NpcHandler.npcs[i].inWild() || PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || FightCaves.isFightCaveNpc(i);
for (int element : AGGRESSIVE_MONSTERS) {
if (NpcHandler.npcs[i].npcType == element || aggressive) {
@@ -27,5 +28,8 @@ public class NpcAggressive {
}
}
return false;
} catch (NullPointerException) {
return false;
}
}
}