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
This commit is contained in:
2015-01-30 12:58:39 -05:00
parent 2de0b76454
commit e0baecef4d
3 changed files with 4 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ void give_gold(short amount,bool print_result) {
bool take_gold(short amount,bool print_result) { bool take_gold(short amount,bool print_result) {
if(univ.party.gold < amount) if(univ.party.gold < amount)
return false; return false;
univ.party.gold += amount; univ.party.gold -= amount;
if(print_result) if(print_result)
put_pc_screen(); put_pc_screen();
return true; return true;

View File

@@ -3158,6 +3158,7 @@ void ifthen_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type,
*next_spec = spec.ex1b; *next_spec = spec.ex1b;
break; break;
case eSpecType::IF_FIELDS: case eSpecType::IF_FIELDS:
if(is_out()) break;
if(!isValidField(spec.m1, false)) { if(!isValidField(spec.m1, false)) {
giveError("Scenario tried to check for invalid field type (1...24)"); giveError("Scenario tried to check for invalid field type (1...24)");
break; break;
@@ -3266,6 +3267,7 @@ void ifthen_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type,
*next_spec = spec.ex1b; *next_spec = spec.ex1b;
break; break;
} }
spec.ex2b = 0;
} }
if(check_party_stat(eSkill(spec.ex2a), spec.ex2b) >= spec.ex1a) if(check_party_stat(eSkill(spec.ex2a), spec.ex2b) >= spec.ex1a)
*next_spec = spec.ex1b; *next_spec = spec.ex1b;

View File

@@ -207,7 +207,7 @@ void start_town_mode(short which_town, short entry_dir) {
switch(univ.town.monst[j].time_flag){ switch(univ.town.monst[j].time_flag){
case eMonstTime::ALWAYS: break; // Nothing to do. case eMonstTime::ALWAYS: break; // Nothing to do.
case eMonstTime::SOMETIMES_A: case eMonstTime::SOMETIMES_B: case eMonstTime::SOMETIMES_C: 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; univ.town.monst[j].active = 0;
else { else {
univ.town.monst[j].active = 1; univ.town.monst[j].active = 1;