White scroll & PiratePQ fix + Party for starters + concurrency protection on event scripts
Fixed successful scrolled items not using up an upgrade slot when using white scroll. Fixed some issues with the PiratePQ and added a "clear all boxes to complete a stage"-mode. Added "Party for Starters" feature. Added concurrency protection on event script modules.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package net.server.world;
|
||||
|
||||
import client.MapleClient;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
@@ -195,6 +196,24 @@ public class MapleParty {
|
||||
return slot;
|
||||
}
|
||||
|
||||
public void assignNewLeader(MapleClient c) {
|
||||
World world = c.getWorldServer();
|
||||
MaplePartyCharacter newLeadr = null;
|
||||
|
||||
lock.lock();
|
||||
try {
|
||||
for(MaplePartyCharacter mpc : members) {
|
||||
if(mpc.getId() != leaderId && (newLeadr == null || newLeadr.getLevel() < mpc.getLevel())) {
|
||||
newLeadr = mpc;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
if(newLeadr != null) world.updateParty(this.getId(), PartyOperation.CHANGE_LEADER, newLeadr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
||||
Reference in New Issue
Block a user