From ef32a4bba790b551821cbcf5b98d9416c86a2761 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 4 Dec 2024 18:11:22 +0100 Subject: small fixes --- src/world.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index 14000d3..bd04a52 100644 --- a/src/world.c +++ b/src/world.c @@ -288,6 +288,7 @@ truck* world_get_truck_by_type(world* world, s32 type) void add_truck_to_world_location(world* world, world_location* location, truck* tr) { log_assert(location->trucks.length < MAX_TRUCK_COUNT, "Too many trucks"); + tr->assigned_employee = 0; tr->id = world->next_id++; array_push(&location->trucks, tr); } @@ -681,16 +682,16 @@ world* world_create_new(bool create_default_state) new_world->money = 100000.0f; new_world->next_id = 1; new_world->active_jobs = array_create(sizeof(active_job)); - new_world->investments = (company_investments){10000,10000,10000,10000}; + new_world->investments = (company_investments){0,0,0,0}; new_world->simulation_speed = 1; new_world->days_since_last_random_event = 0;//-365; // No random events in the first year. new_world->log.events = array_create(sizeof(event)); new_world->log.write_cursor = 0; new_world->log.has_unread_messages = false; new_world->bank_info = (bank){0}; - new_world->bank_info.loan1 = (bank_loan){10000, 3, 12, 846.94, 0}; - new_world->bank_info.loan2 = (bank_loan){50000, 5, 12, 4280.38, 0}; - new_world->bank_info.loan3 = (bank_loan){150000, 8, 12, 13048.27, 0}; + new_world->bank_info.loan1 = (bank_loan){10000, 3, 12, 846.94*6, 0}; + new_world->bank_info.loan2 = (bank_loan){50000, 5, 12, 4280.38*6, 0}; + new_world->bank_info.loan3 = (bank_loan){150000, 8, 12, 13048.27*6, 0}; array_reserve(&new_world->log.events, LOG_HISTORY_LENGTH); new_world->insights = array_create(sizeof(money_data_collection)); @@ -743,7 +744,7 @@ world* world_create_new(bool create_default_state) } world_assign_new_job_offers(new_world, true); - enable_insights_for_current_month(new_world); + if (create_default_state) enable_insights_for_current_month(new_world); world_update_location_scores(new_world); return new_world; -- cgit v1.2.3-70-g09d2