From a6a60d7d465c0eebaa93011914abd3ab16bf6c05 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 30 Nov 2024 22:25:40 +0100 Subject: close #8 --- src/world.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index ec251de..1750608 100644 --- a/src/world.c +++ b/src/world.c @@ -1188,6 +1188,7 @@ static void world_start_random_events(world* world) bool run_event = change_of_random_event >= (get_random_number(0, 100)/100.0f); + //world_report_event(world, "Random event", ); (void)run_event; // TODO start event. } } @@ -1219,11 +1220,11 @@ static void end_contract_with_employee(world* world, employee* emp) // Remove active job active_job* curr_job = get_active_job_by_id(world, emp->active_job_id); - array_remove_by(&world->active_jobs, curr_job); + if (curr_job) array_remove_by(&world->active_jobs, curr_job); // Remove employee from original location world_location* orig_loc = get_world_location_by_id(world, emp->original_location_id); - array_remove_by(&orig_loc->employees, &emp); + if (orig_loc) array_remove_by(&orig_loc->employees, &emp); // Remove employee from current location world_location* curr_loc = get_world_location_by_id(world, emp->current_location_id); -- cgit v1.2.3-70-g09d2