mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-19 16:57:20 +07:00
Fixed issue where engine entities weren't cleared after exiting GameScreen
This commit is contained in:
parent
801df645a3
commit
00c7a6c31a
@ -12,6 +12,12 @@ public class Engine implements Iterable<Entity> {
|
||||
|
||||
public Engine() {}
|
||||
|
||||
public void clear() {
|
||||
entitiesById.clear();
|
||||
entities.clear();
|
||||
nextEntityId = 33;
|
||||
}
|
||||
|
||||
public Entity getEntity(int id) {
|
||||
return entitiesById.get(id);
|
||||
}
|
||||
|
@ -749,6 +749,7 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
Riiablo.engine.clear();
|
||||
stage.dispose();
|
||||
escapePanel.dispose();
|
||||
controlPanel.dispose();
|
||||
|
Loading…
Reference in New Issue
Block a user