From e0baecef4db5eb15a48bfbff619629cd74772aba Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Fri, 30 Jan 2015 12:58:39 -0500 Subject: [PATCH] Several little fixes - Fix take_gold function adding to party gold instead of subtracting - Fix wandering NPCs not appearing if the town was stored in a save slot - If IF_FIELDS node called while outdoors, skip to jumpto - If IF_STATISTIC called on selected target with whole party selected, default to cumulative check --- src/boe.items.cpp | 2 +- src/boe.specials.cpp | 2 ++ src/boe.town.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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;