npcunaggroarea: Local Player NPE Fix (#1350)
* Add local player null check * final for Ganom
This commit is contained in:
@@ -307,9 +307,15 @@ public class NpcAggroAreaPlugin extends Plugin
|
|||||||
|
|
||||||
// Most NPCs stop aggroing when the player has more than double
|
// Most NPCs stop aggroing when the player has more than double
|
||||||
// its combat level.
|
// its combat level.
|
||||||
int playerLvl = client.getLocalPlayer().getCombatLevel();
|
final Player localPlayer = client.getLocalPlayer();
|
||||||
int npcLvl = composition.getCombatLevel();
|
if (localPlayer == null)
|
||||||
String npcName = composition.getName().toLowerCase();
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int playerLvl = localPlayer.getCombatLevel();
|
||||||
|
final int npcLvl = composition.getCombatLevel();
|
||||||
|
final String npcName = composition.getName().toLowerCase();
|
||||||
if (npcLvl > 0 && playerLvl > npcLvl * 2 && !isInWilderness(npc.getWorldLocation()))
|
if (npcLvl > 0 && playerLvl > npcLvl * 2 && !isInWilderness(npc.getWorldLocation()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user