The great MCPQ Merge offensive
Fulfilled the lovely pull request #427 from @dragoso, which added in backing code content to HeavenMS. Implemented structural changes for the Marriage wishlist, in order to receive, maintain and distribute gifts to spouses. Added untradeable check on wishlist gift handler. Adjusted CPQ drops to actually load from DB rathe than hard-coded. Fixed CPQ "random disease to player/party" functionality not applying properly. Adjusted how CPQ maps are generated. It directly loads a new area from WZ (this process should at least removes the player's spawned mobs) rather than reset the cache at every MCPQ creation.
This commit is contained in:
@@ -166,18 +166,20 @@ public class MapleMapFactory {
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized MapleMap loadMapFromWz(int mapid, Integer omapid) {
|
||||
private synchronized MapleMap loadMapFromWz(int mapid, Integer omapid, boolean cache) {
|
||||
MapleMap map;
|
||||
|
||||
mapsRLock.lock();
|
||||
try {
|
||||
map = maps.get(omapid);
|
||||
} finally {
|
||||
mapsRLock.unlock();
|
||||
}
|
||||
if (cache) {
|
||||
mapsRLock.lock();
|
||||
try {
|
||||
map = maps.get(omapid);
|
||||
} finally {
|
||||
mapsRLock.unlock();
|
||||
}
|
||||
|
||||
if (map != null) {
|
||||
return map;
|
||||
if (map != null) {
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
String mapName = getMapName(mapid);
|
||||
@@ -389,11 +391,13 @@ public class MapleMapFactory {
|
||||
map.setBackgroundTypes(backTypes);
|
||||
map.generateMapDropRangeCache();
|
||||
|
||||
mapsWLock.lock();
|
||||
try {
|
||||
maps.put(omapid, map);
|
||||
} finally {
|
||||
mapsWLock.unlock();
|
||||
if (cache) {
|
||||
mapsWLock.lock();
|
||||
try {
|
||||
maps.put(omapid, map);
|
||||
} finally {
|
||||
mapsWLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
@@ -410,7 +414,11 @@ public class MapleMapFactory {
|
||||
mapsRLock.unlock();
|
||||
}
|
||||
|
||||
return (map != null) ? map : loadMapFromWz(mapid, omapid);
|
||||
return (map != null) ? map : loadMapFromWz(mapid, omapid, true);
|
||||
}
|
||||
|
||||
public MapleMap getDisposableMap(int mapid) {
|
||||
return loadMapFromWz(mapid, mapid, false);
|
||||
}
|
||||
|
||||
public boolean isMapLoaded(int mapId) {
|
||||
|
||||
Reference in New Issue
Block a user