diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 63bd276f..d784b29a 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -165,6 +165,15 @@ Object *Gui::getHighlightedResourceObject() const{ return NULL; } else { + if(world == NULL) { + throw megaglest_runtime_error("world == NULL"); + } + if(world->getMap() == NULL) { + throw megaglest_runtime_error("world->getMap() == NULL"); + } + if(world->getMap()->getSurfaceCell(highlightedResourceObjectPos) == NULL) { + throw megaglest_runtime_error("world->getMap()->getSurfaceCell(highlightedResourceObjectPos) == NULL"); + } return world->getMap()->getSurfaceCell(highlightedResourceObjectPos)->getObject(); } } diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 786d966f..89d92807 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -4912,6 +4912,7 @@ void MenuStateCustomGame::processScenario() { setupTechList("", false); reloadFactions(false,""); setupTilesetList(""); + updateControlers(); } SetupUIForScenarios(); }