fixed segfault
This commit is contained in:
parent
b85b19c55f
commit
49ebaf8886
2 changed files with 4 additions and 1 deletions
|
@ -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<gamemap::location,unit>::iterator u = units.find(loc);
|
||||
if(u == units.end() || u->second.advances() == false) {
|
||||
return false;
|
||||
|
|
|
@ -769,7 +769,7 @@ void menu::process_help_string(int mousex, int mousey)
|
|||
|
||||
if(size_t(loc.first) < help_.size()) {
|
||||
const std::vector<std::string>& 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";
|
||||
|
|
Loading…
Add table
Reference in a new issue