Merge pull request #11052 from TheStonedTurtle/kbd-nmz

Nmz Plugin - Fix area check to exclude KBD lair
This commit is contained in:
Jordan
2020-03-31 21:01:51 -07:00
committed by GitHub
2 changed files with 16 additions and 2 deletions

View File

@@ -381,7 +381,15 @@ public class DiscordPlugin extends Plugin
return;
}
final DiscordGameEventType discordGameEventType = DiscordGameEventType.fromRegion(playerRegionID);
DiscordGameEventType discordGameEventType = DiscordGameEventType.fromRegion(playerRegionID);
// NMZ uses the same region ID as KBD. KBD is always on plane 0 and NMZ is always above plane 0
// Since KBD requires going through the wilderness there is no EventType for it
if (DiscordGameEventType.MG_NIGHTMARE_ZONE == discordGameEventType
&& client.getLocalPlayer().getWorldLocation().getPlane() == 0)
{
discordGameEventType = null;
}
if (discordGameEventType == null)
{

View File

@@ -243,6 +243,12 @@ public class NightmareZonePlugin extends Plugin
public boolean isInNightmareZone()
{
return Arrays.equals(client.getMapRegions(), NMZ_MAP_REGION);
if (client.getLocalPlayer() == null)
{
return false;
}
// NMZ and the KBD lair uses the same region ID but NMZ uses planes 1-3 and KBD uses plane 0
return client.getLocalPlayer().getWorldLocation().getPlane() > 0 && Arrays.equals(client.getMapRegions(), NMZ_MAP_REGION);
}
}