diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-12-01 11:03:11 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-12-01 11:03:11 +0100 |
| commit | 1470c698a9552fc6892bf5cd1cccc03e80ab8f98 (patch) | |
| tree | a31aead875bf6fa1d440833121e043d204bb2bfd /src/world.c | |
| parent | 315fae0968c0a786a23a1dc6f94bab7056ac6668 (diff) | |
close #36
Diffstat (limited to 'src/world.c')
| -rw-r--r-- | src/world.c | 12 |
1 files changed, 10 insertions, 2 deletions
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--;
+ }
}
}
}
|
