From 49ebaf88861eed05f3d222f0e3b278d328f6fc41 Mon Sep 17 00:00:00 2001 From: Dave White Date: Mon, 14 Jun 2004 21:52:33 +0000 Subject: [PATCH] fixed segfault --- src/dialogs.cpp | 3 +++ src/widgets/menu.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dialogs.cpp b/src/dialogs.cpp index 0359099e6e6..d769907bc52 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -17,6 +17,7 @@ #include "game_config.hpp" #include "language.hpp" #include "log.hpp" +#include "playturn.hpp" #include "preferences.hpp" #include "replay.hpp" #include "show_dialog.hpp" @@ -81,6 +82,8 @@ void advance_unit(const game_data& info, bool animate_unit_advancement(const game_data& info,unit_map& units, gamemap::location loc, display& gui, size_t choice) { + const command_disabler cmd_disabler(&gui); + std::map::iterator u = units.find(loc); if(u == units.end() || u->second.advances() == false) { return false; diff --git a/src/widgets/menu.cpp b/src/widgets/menu.cpp index 5fa9fed7250..2f3fe0dda8f 100644 --- a/src/widgets/menu.cpp +++ b/src/widgets/menu.cpp @@ -769,7 +769,7 @@ void menu::process_help_string(int mousex, int mousey) if(size_t(loc.first) < help_.size()) { const std::vector& row = help_[loc.first]; - if(size_t(loc.second) < help_.size()) { + if(size_t(loc.second) < row.size()) { const std::string& help = row[loc.second]; if(help.empty() == false) { std::cerr << "setting help string from menu to '" << help << "'\n";