Addition of Player isInTimedHuntingZone method.
This commit is contained in:
@@ -10591,7 +10591,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@@ -11053,7 +11053,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@@ -14603,6 +14603,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
Reference in New Issue
Block a user