Turn map id magic numbers into constants
This commit is contained in:
@@ -34,6 +34,7 @@ import client.processor.stat.AssignSPProcessor;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import constants.id.ItemId;
|
||||
import constants.id.MapId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -106,7 +107,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
int mapId = p.readInt();
|
||||
if (itemId / 1000 >= 5041 || mapId / 100000000 == player.getMapId() / 100000000) { //check vip or same continent
|
||||
MapleMap targetMap = c.getChannelServer().getMapFactory().getMap(mapId);
|
||||
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == 999999999 || mapId < 100000000)) {
|
||||
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == MapId.NONE || MapId.isMapleIsland(mapId))) {
|
||||
player.forceChangeMap(targetMap, targetMap.getRandomPlayerSpawnpoint());
|
||||
success = true;
|
||||
} else {
|
||||
@@ -121,7 +122,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
||||
|
||||
if (victim != null) {
|
||||
MapleMap targetMap = victim.getMap();
|
||||
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == 999999999 || targetMap.getId() < 100000000)) {
|
||||
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == MapId.NONE || MapId.isMapleIsland(targetMap.getId()))) {
|
||||
if (!victim.isGM() || victim.gmLevel() <= player.gmLevel()) { // thanks Yoboes for noticing non-GM's being unreachable through rocks
|
||||
player.forceChangeMap(targetMap, targetMap.findClosestPlayerSpawnpoint(victim.getPosition()));
|
||||
success = true;
|
||||
|
||||
Reference in New Issue
Block a user