Fix crash when viewing monster info from menu

This commit is contained in:
2016-05-07 17:57:25 -04:00
parent 4cd7368fbf
commit c59c58e7ab
3 changed files with 3 additions and 2 deletions

View File

@@ -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") {

View File

@@ -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) {

View File

@@ -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;