Clear Cerberus ghost on LOADING game state

When leaving the are with cerberus ghosts player will not receive
despawn events for them and so they will be stuck (they are just GCed
later instead). This solves the issue and goes in line with rest of
logic we have that relies on spawn/despawn events.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-02-10 14:22:08 +01:00
parent 80ed9a8af6
commit b99c8d7480

View File

@@ -75,7 +75,7 @@ public class CerberusPlugin extends Plugin
@Subscribe
public void onGameStateChanged(GameStateChanged event)
{
if (event.getGameState() == GameState.LOGIN_SCREEN || event.getGameState() == GameState.HOPPING)
if (event.getGameState() == GameState.LOADING)
{
ghosts.clear();
}