fix an NPE, order matters!
This commit is contained in:
@@ -792,9 +792,13 @@ public class ArenaListener
|
||||
ArenaClass oldAC = arena.getArenaPlayer(p).getArenaClass();
|
||||
ArenaClass newAC = arena.getClasses().get(className);
|
||||
|
||||
// If they picked the same sign, don't do anything
|
||||
if (oldAC.equals(newAC)) {
|
||||
return;
|
||||
// If they already had a class, make sure to change the "in use" in the Class Limit Manager
|
||||
if (oldAC != null) {
|
||||
// If they picked the same sign, don't do anything
|
||||
if (oldAC.equals(newAC)) {
|
||||
return;
|
||||
}
|
||||
classLimits.playerChangedClass(oldAC);
|
||||
}
|
||||
|
||||
// If they can not join the class, deny them
|
||||
@@ -803,11 +807,6 @@ public class ArenaListener
|
||||
return;
|
||||
}
|
||||
|
||||
// If they already had a class, make sure to change the "in use" in the Class Limit Manager
|
||||
if (oldAC != null) {
|
||||
classLimits.playerChangedClass(oldAC);
|
||||
}
|
||||
|
||||
// Increment the "in use" in the Class Limit Manager
|
||||
classLimits.playerPickedClass(newAC);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user