From 7aa4491766d27c5ab5616b6f4f875146f5505346 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Thu, 5 Dec 2024 08:06:41 +0100 Subject: close #51 --- src/scenes/place_detail.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2