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