summaryrefslogtreecommitdiff
path: root/src/scenes/place_detail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenes/place_detail.c')
-rw-r--r--src/scenes/place_detail.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/scenes/place_detail.c b/src/scenes/place_detail.c
index d28e1df..64d1056 100644
--- a/src/scenes/place_detail.c
+++ b/src/scenes/place_detail.c
@@ -682,7 +682,19 @@ void place_detail_show_schedule_with_highlighted_job(world_location* loc, schedu
void place_detail_show_employee_detail(employee* emp) {
_goto_default_detail_state();
- world_location* original_loc = get_world_location_by_id(_active_world, emp->original_location_id);
+
+ s32 location_id_to_inspect;
+ if (_active_location == 0 || (_active_location->id != emp->current_location_id && _active_location->id != emp->original_location_id)) {
+ s32 location_id_to_inspect = emp->current_location_id;
+ if (location_id_to_inspect == INVALID_ID) {
+ location_id_to_inspect = emp->original_location_id;
+ }
+ }
+ else {
+ location_id_to_inspect = _active_location->id;
+ }
+
+ world_location* original_loc = get_world_location_by_id(_active_world, location_id_to_inspect);
place_detail_set_active_location(original_loc);
game_set_active_scene(GAME_STATE_PLACE_DETAIL);
current_detail_state = PLACE_DETAIL_SHOW_EMPLOYEE;