summaryrefslogtreecommitdiff
path: root/src/world.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-11-30 22:25:40 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-11-30 22:25:40 +0100
commita6a60d7d465c0eebaa93011914abd3ab16bf6c05 (patch)
treed77cb968e328d3d267b514a7947dbfcb163312c8 /src/world.c
parent7b5889667e928c4991fad45930d4ad891863caa2 (diff)
close #8
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c5
1 files changed, 3 insertions, 2 deletions
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);