Unexpirable diseases & Holy Symbol patch
Fixed diseases becoming unexpirable after trying to change channels or entering the Cash Shop. Fixed Holy Symbol acting oddly in solo scenario. Adjusted Summon Sack lv. 9, that would try to spawn mobs with inexistent id on the field.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server;
|
||||
|
||||
import client.MapleDisease;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,11 +32,13 @@ import tools.locks.MonitoredReentrantLock;
|
||||
/**
|
||||
*
|
||||
* @author Danny//changed to map :3
|
||||
* @author Ronan//debuffs to storage as well
|
||||
*/
|
||||
public class PlayerBuffStorage {
|
||||
private int id = (int) (Math.random() * 100);
|
||||
private final Lock lock = new MonitoredReentrantLock(MonitoredLockType.BUFF_STORAGE, true);
|
||||
private Map<Integer, List<PlayerBuffValueHolder>> buffs = new HashMap<>();
|
||||
private Map<Integer, Map<MapleDisease, Long>> diseases = new HashMap<>();
|
||||
|
||||
public void addBuffsToStorage(int chrid, List<PlayerBuffValueHolder> toStore) {
|
||||
lock.lock();
|
||||
@@ -52,7 +55,25 @@ public class PlayerBuffStorage {
|
||||
return buffs.remove(chrid);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addDiseasesToStorage(int chrid, Map<MapleDisease, Long> toStore) {
|
||||
lock.lock();
|
||||
try {
|
||||
diseases.put(chrid, toStore);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public Map<MapleDisease, Long> getDiseasesFromStorage(int chrid) {
|
||||
lock.lock();
|
||||
try {
|
||||
return diseases.remove(chrid);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user