From 8b310bfac4cee194ca69d72dab19ce0578e2134d Mon Sep 17 00:00:00 2001 From: Tenari Date: Thu, 19 Mar 2026 07:51:47 -0500 Subject: [PATCH] fix the job-to-same-system bug + properly reset the passengers tab --- src/client.c | 1 + src/server.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index 8d23687..48a9cbc 100644 --- a/src/client.c +++ b/src/client.c @@ -335,6 +335,7 @@ fn void resetTabRow(Tab tab) { state.row.len = 2; state.row.selected_index = 0; } else if (state.menu.selected_index == TabPassengers) { + state.passenger_tab_state = PassengersTabStateTable; StarSystem s = state.map[state.me.system_idx]; u32 offer_count = 0; for (u32 i = 0; i < MAX_PASSENGER_JOB_OFFERS; i++) { diff --git a/src/server.c b/src/server.c index ad24569..5be9b9a 100644 --- a/src/server.c +++ b/src/server.c @@ -942,7 +942,7 @@ fn void* gameLoop(void* params) { for (u32 ii = 0; ii < max_passenger_job_count; ii++) { if (sys->offers[ii].people == 0) { // TODO choose a system further away - sys->offers[ii].goal_system_idx = (i+(rand() % 6)) % STAR_SYSTEM_COUNT; + sys->offers[ii].goal_system_idx = (i+1+(rand() % 6)) % STAR_SYSTEM_COUNT; sys->offers[ii].people = 1 + (rand() % (MAX_PASSENGER_JOB_PEOPLE - 1)); sys->offers[ii].time_limit = 3 + (rand() % 5); // TODO compute based on distance between people and time_limit @@ -1232,9 +1232,9 @@ i32 main(i32 argc, ptr argv[]) { u32 offer_count = 1 + (rand() % (MAX_PASSENGER_JOB_OFFERS / planet_divisor)); for (u32 ii = 0; ii < offer_count; ii++) { // TODO choose a system further away - state.map[i].offers[ii].goal_system_idx = (i+(rand() % 6)) % STAR_SYSTEM_COUNT; + state.map[i].offers[ii].goal_system_idx = (i+1+(rand() % 6)) % STAR_SYSTEM_COUNT; state.map[i].offers[ii].people = 1 + (rand() % (MAX_PASSENGER_JOB_PEOPLE - 1)); - state.map[i].offers[ii].time_limit = 3 + (rand() % 5); + state.map[i].offers[ii].time_limit = 1 + (rand() % 3); // TODO compute based on distance between people and time_limit state.map[i].offers[ii].offer = 1000 + (rand() % MAX_PASSENGER_JOB_PRICE); }