If in a boat and on a passable space (such as a bridge), pausing now allows you to leave the boat.

Pausing again boards the boat once more.
This commit is contained in:
2015-01-29 01:58:58 -05:00
parent da00da261c
commit 62965891db
3 changed files with 28 additions and 4 deletions

View File

@@ -403,6 +403,30 @@ static void handle_pause(bool& did_something, bool& need_redraw) {
univ.party.in_horse = -1;
}
}
if(univ.party.in_boat >= 0) {
// If you pause on a bridge or other passable terrain, leave boat.
if(overall_mode == MODE_OUTDOORS && !impassable(univ.out[univ.party.p_loc.x][univ.party.p_loc.y])) {
univ.party.boats[univ.party.in_boat].which_town = 200;
univ.party.boats[univ.party.in_boat].loc_in_sec = global_to_local(univ.party.p_loc);
univ.party.boats[univ.party.in_boat].loc = univ.party.p_loc;
univ.party.boats[univ.party.in_boat].sector.x = univ.party.outdoor_corner.x + univ.party.i_w_c.x;
univ.party.boats[univ.party.in_boat].sector.y = univ.party.outdoor_corner.y + univ.party.i_w_c.y;
univ.party.in_boat = -1;
} else if(overall_mode == MODE_TOWN && !impassable(univ.town->terrain(univ.town.p_loc.x,univ.town.p_loc.y))) {
univ.party.boats[univ.party.in_boat].loc = univ.town.p_loc;
univ.party.boats[univ.party.in_boat].which_town = univ.town.num;
univ.party.in_boat = -1;
}
} else {
// The above could leave you stranded in a single-tile passable area, so pausing again should re-enter the boat.
int boat = -1;
if(overall_mode == MODE_OUTDOORS && (boat = out_boat_there(univ.party.p_loc)) < univ.party.boats.size())
univ.party.in_boat = boat;
else if(overall_mode == MODE_TOWN && (boat = town_boat_there(univ.town.p_loc)) < univ.party.boats.size())
univ.party.in_boat = boat;
if(boat >= 0)
ASB("You board the boat.");
}
put_pc_screen();
check_fields(univ.town.p_loc,eSpecCtx::TOWN_MOVE,univ.party[0]);
}

View File

@@ -78,8 +78,8 @@ public:
// TODO: Does this duplicate cCurTown::p_loc? If not, why not?
location p_loc;
location loc_in_sec;
cVehicle boats[30];
cVehicle horses[30];
std::array<cVehicle,30> boats;
std::array<cVehicle,30> horses;
cPopulation creature_save[4];
short in_boat;
short in_horse;

View File

@@ -61,8 +61,8 @@ public:
short rating,uses_custom_graphics;
std::vector<ePicType> custom_graphics;
std::array<cMonster,256> scen_monsters;
cVehicle boats[30];
cVehicle horses[30];
std::array<cVehicle,30> boats;
std::array<cVehicle,30> horses;
std::array<cTerrain,256> ter_types;
short scenario_timer_times[20];
short scenario_timer_specs[20];