Fix the NPE that caused MPS crashes

This commit is contained in:
Sam 2017-07-25 19:22:11 +01:00
parent 789658b2d9
commit 4f221cabba

View File

@ -44,7 +44,6 @@ import nautilus.game.arcade.game.games.moba.kit.hp.HPManager;
import nautilus.game.arcade.game.games.moba.kit.larissa.HeroLarissa; import nautilus.game.arcade.game.games.moba.kit.larissa.HeroLarissa;
import nautilus.game.arcade.game.games.moba.kit.rowena.HeroRowena; import nautilus.game.arcade.game.games.moba.kit.rowena.HeroRowena;
import nautilus.game.arcade.game.games.moba.minion.MinionManager; import nautilus.game.arcade.game.games.moba.minion.MinionManager;
import nautilus.game.arcade.game.games.moba.modes.MobaMap;
import nautilus.game.arcade.game.games.moba.modes.MobaMapType; import nautilus.game.arcade.game.games.moba.modes.MobaMapType;
import nautilus.game.arcade.game.games.moba.overtime.OvertimeManager; import nautilus.game.arcade.game.games.moba.overtime.OvertimeManager;
import nautilus.game.arcade.game.games.moba.progression.MobaProgression; import nautilus.game.arcade.game.games.moba.progression.MobaProgression;
@ -109,8 +108,6 @@ public class Moba extends TeamGame
private PlayerMapBoard _board; private PlayerMapBoard _board;
private MapBoardSelector _selector; private MapBoardSelector _selector;
private MobaMap _map;
private int _inPlayers; private int _inPlayers;
public Moba(ArcadeManager manager, GameType gameType, String[] description) public Moba(ArcadeManager manager, GameType gameType, String[] description)
@ -226,7 +223,7 @@ public class Moba extends TeamGame
mapType = MobaMapType.HEROES_VALLEY; mapType = MobaMapType.HEROES_VALLEY;
} }
_map = registerManager(mapType.createInstance(this)); registerManager(mapType.createInstance(this));
if (Manager.IsRewardStats() && Manager.GetLobby() instanceof NewGameLobbyManager) if (Manager.IsRewardStats() && Manager.GetLobby() instanceof NewGameLobbyManager)
{ {
@ -315,7 +312,7 @@ public class Moba extends TeamGame
private void cleanupLobby() private void cleanupLobby()
{ {
if (_mapManager != null) if (_mapManager != null && _board != null)
{ {
_mapManager.cleanupBoard(_board); _mapManager.cleanupBoard(_board);
_selector.cleanup(); _selector.cleanup();