From 1470c698a9552fc6892bf5cd1cccc03e80ab8f98 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 1 Dec 2024 11:03:11 +0100 Subject: close #36 --- src/world.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index 1969193..a27d468 100644 --- a/src/world.c +++ b/src/world.c @@ -1088,7 +1088,6 @@ static void world_update_active_jobs(world* world) float multiplier = 1.0f + (world->investments.training/100.0f) * 0.025f; if (multiplier < 1.0f) multiplier = 1.0f; if (multiplier > 5.0f) multiplier = 5.0f; - printf("%f\n", multiplier); e->experience += 0.01f * multiplier; } } @@ -1444,12 +1443,21 @@ static void world_age_employee(world* world) { world_location* location = array_at(&world->locations, i); if (!location->is_owned) continue; - + for (s32 x = 0; x < location->employees.length; x++) { employee* em = *(employee**)array_at(&location->employees, x); em->age += 1; em->experience += 1; + + if (em->age >= RETIREMENT_AGE) { + char error_msg[MAX_EVENT_MESSAGE_LENGTH]; + snprintf(error_msg, MAX_EVENT_MESSAGE_LENGTH, "%s retired at age %d. Their routes need a new assignee!", em->name, RETIREMENT_AGE); + world_report_event(world, error_msg, EVENT_TYPE_EMPLOYEE_QUIT, location); + end_contract_with_employee(world, em); + + x--; + } } } } -- cgit v1.2.3-70-g09d2