diff --git a/src/boe.items.cpp b/src/boe.items.cpp index 859948be..0d661495 100644 --- a/src/boe.items.cpp +++ b/src/boe.items.cpp @@ -67,7 +67,7 @@ void give_gold(short amount,bool print_result) { bool take_gold(short amount,bool print_result) { if(univ.party.gold < amount) return false; - univ.party.gold += amount; + univ.party.gold -= amount; if(print_result) put_pc_screen(); return true; diff --git a/src/boe.specials.cpp b/src/boe.specials.cpp index 4b66fc2d..1129d161 100644 --- a/src/boe.specials.cpp +++ b/src/boe.specials.cpp @@ -3158,6 +3158,7 @@ void ifthen_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, *next_spec = spec.ex1b; break; case eSpecType::IF_FIELDS: + if(is_out()) break; if(!isValidField(spec.m1, false)) { giveError("Scenario tried to check for invalid field type (1...24)"); break; @@ -3266,6 +3267,7 @@ void ifthen_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, *next_spec = spec.ex1b; break; } + spec.ex2b = 0; } if(check_party_stat(eSkill(spec.ex2a), spec.ex2b) >= spec.ex1a) *next_spec = spec.ex1b; diff --git a/src/boe.town.cpp b/src/boe.town.cpp index 2d922f0d..df0d87e8 100644 --- a/src/boe.town.cpp +++ b/src/boe.town.cpp @@ -207,7 +207,7 @@ void start_town_mode(short which_town, short entry_dir) { switch(univ.town.monst[j].time_flag){ case eMonstTime::ALWAYS: break; // Nothing to do. case eMonstTime::SOMETIMES_A: case eMonstTime::SOMETIMES_B: case eMonstTime::SOMETIMES_C: - if((calc_day() % 3) + 3 != int(univ.town.monst[i].time_flag)) + if((calc_day() % 3) + 3 != int(univ.town.monst[j].time_flag)) univ.town.monst[j].active = 0; else { univ.town.monst[j].active = 1;