diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/include/world.h | 1 | ||||
| -rw-r--r-- | src/world.c | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/include/world.h b/src/include/world.h index 1efa553..46e2f65 100644 --- a/src/include/world.h +++ b/src/include/world.h @@ -47,6 +47,7 @@ typedef struct t_employee employee; #define SHIPTIME_DURATION_MULTIPLIER_MAX 1.0f
#define SHIPTIME_DURATION_MULTIPLIER_MIN 1.15f
#define DIESEL_PRICE_PER_LITER 1.4f
+#define RETIREMENT_AGE 65
#define INVALID_ID 0
#define MAX_WORKED_HOURS_WEEKLY (50.0f)
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--;
+ }
}
}
}
|
