Fixed chair exploit & beholder issue + Mini-dungeon revamp

Fixed an (quite amusing) exploit with map chairs stacking "extra healing" schedules on certain conditions. Fixed mini-dungeon not disposing players properly in some cases. Refactored the mini-dungeon structure. Fixed an issue on CASH inventory merging same items when trying to swap them. Fixed Beholder crash issue when trying to enter Cash Shop.
This commit is contained in:
ronancpl
2017-10-16 15:13:42 -02:00
parent 1ec7487bd3
commit 57c29603d1
96 changed files with 632 additions and 434 deletions

View File

@@ -1979,19 +1979,11 @@ public class MapleMap {
if (chr.getEventInstance() != null) {
chr.getEventInstance().movePlayer(chr);
}
} else if (MapleMiniDungeon.isDungeonMap(mapid)) {
final MapleMiniDungeon dungeon = MapleMiniDungeon.getDungeon(mapid);
chr.getClient().announce(MaplePacketCreator.getClock(30 * 60));
TimerManager.getInstance().schedule(new Runnable() {
@Override
public void run() {
if (MapleMiniDungeon.isDungeonMap(chr.getMapId())) {
chr.changeMap(dungeon.getBase());
}
}
}, 30 * 60 * 1000);
} else if (MapleMiniDungeonInfo.isDungeonMap(mapid)) {
MapleMiniDungeon mmd = chr.getClient().getChannelServer().getMiniDungeon(mapid);
if(mmd != null) mmd.registerPlayer(chr);
}
MaplePet[] pets = chr.getPets();
for (int i = 0; i < pets.length; i++) {
if (pets[i] != null) {
@@ -2152,6 +2144,16 @@ public class MapleMap {
} finally {
chrWLock.unlock();
}
if (MapleMiniDungeonInfo.isDungeonMap(mapid)) {
MapleMiniDungeon mmd = chr.getClient().getChannelServer().getMiniDungeon(mapid);
if(mmd != null) {
if(!mmd.unregisterPlayer(chr)) {
chr.getClient().getChannelServer().removeMiniDungeon(mapid);
}
}
}
removeMapObject(chr.getObjectId());
if (!chr.isHidden()) {
broadcastMessage(MaplePacketCreator.removePlayerFromMap(chr.getId()));