summaryrefslogtreecommitdiff
path: root/src/world.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c12
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--;
+ }
}
}
}