Don't force movement if special node #50 was called
This commit is contained in:
@@ -2831,19 +2831,17 @@ static void run_waterfalls(short mode){ // mode 0 - town, 1 - outdoors
|
||||
}
|
||||
|
||||
bool outd_move_party(location destination,bool forced) {
|
||||
short boat_num,horse_num,spec_num;
|
||||
short boat_num,horse_num;
|
||||
location real_dest, sector_p_in;
|
||||
bool keep_going = true,check_f;
|
||||
location store_corner,store_iwc;
|
||||
ter_num_t ter;
|
||||
|
||||
keep_going = check_special_terrain(destination,eSpecCtx::OUT_MOVE,univ.party[0],&spec_num,&check_f);
|
||||
keep_going = check_special_terrain(destination,eSpecCtx::OUT_MOVE,univ.party[0],&check_f);
|
||||
if(check_f)
|
||||
forced = true;
|
||||
if(in_scen_debug && ghost_mode)
|
||||
forced = keep_going = true;
|
||||
if(spec_num == 50)
|
||||
forced = true;
|
||||
|
||||
// If not blocked and not put in town by a special, process move
|
||||
if(keep_going && overall_mode == MODE_OUTDOORS) {
|
||||
@@ -3030,7 +3028,7 @@ bool outd_move_party(location destination,bool forced) {
|
||||
|
||||
bool town_move_party(location destination,short forced) {
|
||||
bool keep_going = true;
|
||||
short boat_there,horse_there,spec_num;
|
||||
short boat_there,horse_there;
|
||||
ter_num_t ter;
|
||||
bool check_f = false;
|
||||
|
||||
@@ -3040,14 +3038,12 @@ bool town_move_party(location destination,short forced) {
|
||||
}
|
||||
|
||||
if(univ.target_there(destination, TARG_MONST) == nullptr)
|
||||
keep_going = check_special_terrain(destination,eSpecCtx::TOWN_MOVE,univ.party[0],&spec_num,&check_f);
|
||||
keep_going = check_special_terrain(destination,eSpecCtx::TOWN_MOVE,univ.party[0],&check_f);
|
||||
if(check_f)
|
||||
forced = true;
|
||||
if(in_scen_debug && ghost_mode)
|
||||
forced = keep_going = true;
|
||||
|
||||
if(spec_num == 50)
|
||||
forced = true;
|
||||
ter = univ.town->terrain(destination.x,destination.y);
|
||||
|
||||
if(keep_going) {
|
||||
|
@@ -378,7 +378,6 @@ bool pc_combat_move(location destination) {
|
||||
short s1,s2,i,monst_exist;
|
||||
bool keep_going = true,forced = false,check_f = false;
|
||||
location monst_loc,store_loc;
|
||||
short spec_num;
|
||||
eDirection dir;
|
||||
|
||||
iLiving* monst_hit = univ.target_there(destination, TARG_MONST);
|
||||
@@ -390,7 +389,7 @@ bool pc_combat_move(location destination) {
|
||||
}
|
||||
|
||||
if(monst_hit == nullptr)
|
||||
keep_going = check_special_terrain(destination,eSpecCtx::COMBAT_MOVE,univ.party[current_pc],&spec_num,&check_f);
|
||||
keep_going = check_special_terrain(destination,eSpecCtx::COMBAT_MOVE,univ.party[current_pc],&check_f);
|
||||
if(check_f)
|
||||
forced = true;
|
||||
|
||||
@@ -452,7 +451,7 @@ bool pc_combat_move(location destination) {
|
||||
switch_pc.combat_pos = store_loc;
|
||||
univ.party[current_pc].direction = dir;
|
||||
take_ap(1);
|
||||
check_special_terrain(store_loc,eSpecCtx::COMBAT_MOVE,switch_pc,&spec_num,&check_f);
|
||||
check_special_terrain(store_loc,eSpecCtx::COMBAT_MOVE,switch_pc,&check_f);
|
||||
move_sound(univ.town->terrain(destination.x,destination.y),univ.party[current_pc].ap);
|
||||
return true;
|
||||
}
|
||||
|
@@ -116,8 +116,7 @@ bool handle_wandering_specials (short /*which*/,short mode) {
|
||||
|
||||
// returns true if can enter this space
|
||||
// sets forced to true if definitely can enter
|
||||
bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,short *spec_num,
|
||||
bool *forced) {
|
||||
bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,bool *forced) {
|
||||
ter_num_t ter;
|
||||
short r1,i,door_pc,pic_type = 0,ter_pic = 0;
|
||||
eTerSpec ter_special;
|
||||
@@ -128,7 +127,7 @@ bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,
|
||||
location out_where,from_loc,to_loc;
|
||||
short s1 = 0,s2 = 0,s3 = 0;
|
||||
|
||||
*spec_num = -1;
|
||||
short spec_num = -1;
|
||||
*forced = false;
|
||||
|
||||
switch(mode) {
|
||||
@@ -173,9 +172,9 @@ bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,
|
||||
|
||||
for(i = 0; i < univ.out->special_locs.size(); i++)
|
||||
if(out_where == univ.out->special_locs[i]) {
|
||||
*spec_num = univ.out->special_locs[i].spec;
|
||||
spec_num = univ.out->special_locs[i].spec;
|
||||
// call special
|
||||
run_special(mode,1,univ.out->special_locs[i].spec,out_where,&s1,&s2,&s3);
|
||||
run_special(mode,1,spec_num,out_where,&s1,&s2,&s3);
|
||||
if(s1 > 0)
|
||||
can_enter = false;
|
||||
else if(s2 > 0)
|
||||
@@ -204,18 +203,18 @@ bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,
|
||||
&& can_enter && univ.town.is_special(where_check.x,where_check.y)) {
|
||||
for(i = 0; i < univ.town->special_locs.size(); i++)
|
||||
if(where_check == univ.town->special_locs[i]) {
|
||||
*spec_num = univ.town->special_locs[i].spec;
|
||||
spec_num = univ.town->special_locs[i].spec;
|
||||
bool runSpecial = false;
|
||||
if(!is_blocked(where_check)) runSpecial = true;
|
||||
if(ter_special == eTerSpec::CHANGE_WHEN_STEP_ON) runSpecial = true;
|
||||
if(ter_special == eTerSpec::CALL_SPECIAL) runSpecial = true;
|
||||
if(univ.town->specials[*spec_num].type == eSpecType::CANT_ENTER)
|
||||
if(univ.town->specials[spec_num].type == eSpecType::CANT_ENTER)
|
||||
runSpecial = true;
|
||||
if(!PSD[SDF_NO_BOAT_SPECIALS] && univ.party.in_boat >= 0 && univ.scenario.ter_types[ter].boat_over)
|
||||
runSpecial = true;
|
||||
if(runSpecial) {
|
||||
give_help(54,0);
|
||||
run_special(mode,2,*spec_num,where_check,&s1,&s2,&s3);
|
||||
run_special(mode,2,spec_num,where_check,&s1,&s2,&s3);
|
||||
if(s1 > 0)
|
||||
can_enter = false;
|
||||
else if(s2 > 0)
|
||||
|
@@ -2,8 +2,7 @@
|
||||
#include "creature.hpp"
|
||||
|
||||
bool handle_wandering_specials (short which,short mode);
|
||||
bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,short *spec_num,
|
||||
bool *forced);
|
||||
bool check_special_terrain(location where_check,eSpecCtx mode,cPlayer& which_pc,bool *forced);
|
||||
void check_fields(location where_check,eSpecCtx mode,cPlayer& which_pc);
|
||||
void use_spec_item(short item);
|
||||
void use_item(short pc,short item);
|
||||
|
Reference in New Issue
Block a user