mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-05 15:58:38 +07:00
Fixed issue where game would crash if trying to enter multiple games in a single instance
This commit is contained in:
@ -431,6 +431,11 @@ public class CharData {
|
||||
for (EquippedListener l : EQUIPPED_LISTENERS) l.onAlternated(this, alternate, LH, RH);
|
||||
}
|
||||
|
||||
public void clearListeners() {
|
||||
EQUIPPED_LISTENERS.clear();
|
||||
SKILLS_LISTENERS.clear();
|
||||
}
|
||||
|
||||
public boolean addEquippedListener(EquippedListener l) {
|
||||
EQUIPPED_LISTENERS.add(l);
|
||||
return true;
|
||||
|
@ -766,6 +766,7 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
charData.clearListeners();
|
||||
engine.removeAllEntities();
|
||||
engine.removeAllSystems();
|
||||
for (Actor actor : stage.getActors()) if (actor instanceof Disposable) ((Disposable) actor).dispose();
|
||||
|
Reference in New Issue
Block a user