From ac93dbe09f5a1a46f90f49cc9037765dfbf33082 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 14 Aug 2016 22:34:16 -0400 Subject: [PATCH] Fix some uses of wrong location --- src/boe.actions.cpp | 3 +-- src/boe.items.cpp | 3 +-- src/boe.specials.cpp | 9 +++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/boe.actions.cpp b/src/boe.actions.cpp index 04458c068..31ef9b14c 100644 --- a/src/boe.actions.cpp +++ b/src/boe.actions.cpp @@ -2777,8 +2777,7 @@ static void run_waterfalls(short mode){ // mode 0 - town, 1 - outdoors y += 2 * dir_y_dif[dir]; univ.party.town_loc.x += 2 * dir_x_dif[dir]; univ.party.town_loc.y += 2 * dir_y_dif[dir]; - // TODO: Why out_loc here? - update_explored(univ.party.out_loc); + update_explored(univ.party.town_loc); }else{ x += 2 * dir_x_dif[dir]; y += 2 * dir_y_dif[dir]; diff --git a/src/boe.items.cpp b/src/boe.items.cpp index 9df5f3a91..0a6e306b3 100644 --- a/src/boe.items.cpp +++ b/src/boe.items.cpp @@ -361,8 +361,7 @@ void set_town_attitude(short lo,short hi,eAttitude att) { // In some towns, doin' this'll getcha' killed. // (Or something else! Killing the party would be the responsibility of whatever special node is called.) if(univ.town.monst.hostile && univ.town->spec_on_hostile >= 0) - // TODO: Why passing out_loc here? - run_special(eSpecCtx::TOWN_HOSTILE, 2, univ.town->spec_on_hostile, univ.party.out_loc, &a[0], &a[1], &a[2]); + run_special(eSpecCtx::TOWN_HOSTILE, 2, univ.town->spec_on_hostile, univ.party.town_loc, &a[0], &a[1], &a[2]); } // TODO: Set town status to "dead"? Could reuse above with magic att (eg -1), or write new function. diff --git a/src/boe.specials.cpp b/src/boe.specials.cpp index 8265e378f..9a6c6a65f 100644 --- a/src/boe.specials.cpp +++ b/src/boe.specials.cpp @@ -510,9 +510,8 @@ void check_fields(location where_check,eSpecCtx mode,cPlayer& which_pc) { r1 = get_ran(2,1,6); if(mode == eSpecCtx::COMBAT_MOVE) damage_pc(which_pc,r1,eDamageType::COLD,eRace::UNKNOWN,0); - // TODO: Why check out_loc here? if(overall_mode < MODE_COMBAT) - boom_space(univ.party.out_loc,overall_mode,4,r1,7); + boom_space(univ.party.town_loc,overall_mode,4,r1,7); } if(univ.town.is_blade_wall(where_check.x,where_check.y)) { add_string_to_buf(" Blade wall!"); @@ -550,8 +549,7 @@ void use_spec_item(short item) { short i,j,k; location null_loc; - // TODO: Why pass out_loc here? - run_special(eSpecCtx::USE_SPEC_ITEM,0,univ.scenario.special_items[item].special,univ.party.out_loc,&i,&j,&k); + run_special(eSpecCtx::USE_SPEC_ITEM,0,univ.scenario.special_items[item].special,univ.party.get_loc(),&i,&j,&k); } @@ -1778,8 +1776,7 @@ void push_things() { univ.town.set_crate(univ.party[i].combat_pos.x,univ.party[i].combat_pos.y,false); ASB("You smash the crate."); } - // TODO: Why checking town_loc instead of combat_pos here? - if(univ.town.is_block(univ.party.town_loc.x,univ.party.town_loc.y)) { + if(univ.town.is_block(univ.party[i].combat_pos.x,univ.party[i].combat_pos.y)) { ASB("You crash into the block."); damage_pc(univ.party[i],get_ran(1, 1, 6), eDamageType::WEAPON,eRace::UNKNOWN,0); }