From c59c58e7ab4c82737ec721fc74d269b9404eba3a Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 7 May 2016 17:57:25 -0400 Subject: [PATCH] Fix crash when viewing monster info from menu --- src/boe.infodlg.cpp | 1 + src/boe.menus.win.cpp | 2 +- src/scenedit/scen.actions.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/boe.infodlg.cpp b/src/boe.infodlg.cpp index b2ab5aef..8f1a9109 100644 --- a/src/boe.infodlg.cpp +++ b/src/boe.infodlg.cpp @@ -400,6 +400,7 @@ static void put_monst_info(cDialog& me, const cCreature& store_m) { static bool display_monst_event_filter(cDialog& me, std::string item_hit, cCreature& store_m) { // This is a bit hacky; keep a cPopulation here to handle the full roster; it's treated like a rotating buffer. static cPopulation roster; + roster.init(60); short i; if(item_hit == "left") { diff --git a/src/boe.menus.win.cpp b/src/boe.menus.win.cpp index af2cf8d5..bd909816 100644 --- a/src/boe.menus.win.cpp +++ b/src/boe.menus.win.cpp @@ -298,7 +298,7 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara if(message == WM_COMMAND) { int cmd = LOWORD(wParam); if(cmd >= 1000 && cmd < 2000) { - handle_monster_info_menu(cmd - 1000); + handle_monster_info_menu(cmd - 1000 + 1); } else if(cmd >= 2000 && cmd < 3000) { handle_menu_spell(cSpell::fromNum(eSkill::MAGE_SPELLS, cmd - 2000)); } else if(cmd >= 3000 && cmd < 4000) { diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index 65124087..c0595ace 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -1606,9 +1606,9 @@ void handle_action(location the_point,sf::Event /*event*/) { cur_point = the_point; cur_point.x -= RIGHT_AREA_UL_X; cur_point.y -= RIGHT_AREA_UL_Y; - if(handle_terpal_action(cur_point, option_hit)) return; + cur_point2 = the_point; cur_point2.x -= 5; cur_point2.y -= terrain_rects[255].bottom + 5;