Make PlayerStorage.getAllCharacters() return a copy (#386)
* Clear continent drops when using !reloaddrops * Return a copy on PlayerStorage.getAllCharacters()
This commit is contained in:
@@ -84,7 +84,7 @@ public class PlayerStorage {
|
||||
public Collection<MapleCharacter> getAllCharacters() {
|
||||
rlock.lock();
|
||||
try {
|
||||
return storage.values();
|
||||
return new ArrayList<>(storage.values());
|
||||
} finally {
|
||||
rlock.unlock();
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ public class World {
|
||||
}
|
||||
|
||||
public void setExpRate(int exp) {
|
||||
List<MapleCharacter> list = new LinkedList<>(getPlayerStorage().getAllCharacters());
|
||||
Collection<MapleCharacter> list = getPlayerStorage().getAllCharacters();
|
||||
|
||||
for(MapleCharacter chr : list) {
|
||||
if(!chr.isLoggedin()) continue;
|
||||
@@ -311,7 +311,7 @@ public class World {
|
||||
}
|
||||
|
||||
public void setDropRate(int drop) {
|
||||
List<MapleCharacter> list = new LinkedList<>(getPlayerStorage().getAllCharacters());
|
||||
Collection<MapleCharacter> list = getPlayerStorage().getAllCharacters();
|
||||
|
||||
for(MapleCharacter chr : list) {
|
||||
if(!chr.isLoggedin()) continue;
|
||||
@@ -337,8 +337,8 @@ public class World {
|
||||
}
|
||||
|
||||
public void setMesoRate(int meso) {
|
||||
List<MapleCharacter> list = new LinkedList<>(getPlayerStorage().getAllCharacters());
|
||||
|
||||
Collection<MapleCharacter> list = getPlayerStorage().getAllCharacters();
|
||||
|
||||
for(MapleCharacter chr : list) {
|
||||
if(!chr.isLoggedin()) continue;
|
||||
chr.revertWorldRates();
|
||||
|
||||
Reference in New Issue
Block a user