Merge pull request #11052 from TheStonedTurtle/kbd-nmz
Nmz Plugin - Fix area check to exclude KBD lair
This commit is contained in:
@@ -381,7 +381,15 @@ public class DiscordPlugin extends Plugin
|
|||||||
return;
|
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)
|
if (discordGameEventType == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -243,6 +243,12 @@ public class NightmareZonePlugin extends Plugin
|
|||||||
|
|
||||||
public boolean isInNightmareZone()
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user