Skip to content

Commit

Permalink
Fix 'Reach Refugee Center' mission location and pathing over bridges (C…
Browse files Browse the repository at this point in the history
  • Loading branch information
haveric authored Feb 17, 2022
1 parent 79f822c commit 7c16f61
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"value": 0,
"start": "reveal_refugee_center",
"origins": [ "ORIGIN_COMPUTER" ],
"destination": "refctr_S3e"
"destination": "evac_center_18"
}
]
3 changes: 2 additions & 1 deletion data/json/overmap/overmap_connections.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
{ "terrain": "road", "locations": [ "forest_trail" ], "basic_cost": 25 },
{ "terrain": "road", "locations": [ "swamp" ], "basic_cost": 40 },
{ "terrain": "road_nesw_manhole", "locations": [ ] },
{ "terrain": "bridge", "locations": [ "water" ], "basic_cost": 120 }
{ "terrain": "bridge", "locations": [ "water" ], "basic_cost": 120 },
{ "terrain": "bridgehead_ground", "locations": [ "water" ], "basic_cost": 120 }
]
},
{
Expand Down
12 changes: 10 additions & 2 deletions src/mission_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ void mission_start::reveal_refugee_center( mission *miss )
t.overmap_special = overmap_special_evac_center;
t.mission_pointer = miss;
t.search_range = 0;
t.reveal_radius = 3;
t.reveal_radius = 1;

const cata::optional<tripoint_abs_omt> target_pos = mission_util::assign_mission_target( t );
cata::optional<tripoint_abs_omt> target_pos = mission_util::assign_mission_target( t );

if( !target_pos ) {
add_msg( _( "You don't know where the address could be…" ) );
Expand All @@ -664,6 +664,14 @@ void mission_start::reveal_refugee_center( mission *miss )
const tripoint_abs_omt dest_road = overmap_buffer.find_closest( *target_pos, "road", 3, false );

if( overmap_buffer.reveal_route( source_road, dest_road, 1, true ) ) {
//reset the mission target to the refugee center entrance and reveal path from the road
t.overmap_terrain = "evac_center_18";
t.reveal_radius = 3;
target_pos = mission_util::assign_mission_target( t );
const tripoint_abs_omt dest_refugee_center = overmap_buffer.find_closest( *target_pos,
"evac_center_18", 1, false );
overmap_buffer.reveal_route( dest_road, dest_refugee_center, 1, false );

add_msg( _( "You mark the refugee center and the road that leads to it…" ) );
} else {
add_msg( _( "You mark the refugee center, but you have no idea how to get there by road…" ) );
Expand Down

0 comments on commit 7c16f61

Please sign in to comment.