fix the job-to-same-system bug + properly reset the passengers tab
This commit is contained in:
@@ -335,6 +335,7 @@ fn void resetTabRow(Tab tab) {
|
|||||||
state.row.len = 2;
|
state.row.len = 2;
|
||||||
state.row.selected_index = 0;
|
state.row.selected_index = 0;
|
||||||
} else if (state.menu.selected_index == TabPassengers) {
|
} else if (state.menu.selected_index == TabPassengers) {
|
||||||
|
state.passenger_tab_state = PassengersTabStateTable;
|
||||||
StarSystem s = state.map[state.me.system_idx];
|
StarSystem s = state.map[state.me.system_idx];
|
||||||
u32 offer_count = 0;
|
u32 offer_count = 0;
|
||||||
for (u32 i = 0; i < MAX_PASSENGER_JOB_OFFERS; i++) {
|
for (u32 i = 0; i < MAX_PASSENGER_JOB_OFFERS; i++) {
|
||||||
|
|||||||
+3
-3
@@ -942,7 +942,7 @@ fn void* gameLoop(void* params) {
|
|||||||
for (u32 ii = 0; ii < max_passenger_job_count; ii++) {
|
for (u32 ii = 0; ii < max_passenger_job_count; ii++) {
|
||||||
if (sys->offers[ii].people == 0) {
|
if (sys->offers[ii].people == 0) {
|
||||||
// TODO choose a system further away
|
// 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].people = 1 + (rand() % (MAX_PASSENGER_JOB_PEOPLE - 1));
|
||||||
sys->offers[ii].time_limit = 3 + (rand() % 5);
|
sys->offers[ii].time_limit = 3 + (rand() % 5);
|
||||||
// TODO compute based on distance between people and time_limit
|
// 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));
|
u32 offer_count = 1 + (rand() % (MAX_PASSENGER_JOB_OFFERS / planet_divisor));
|
||||||
for (u32 ii = 0; ii < offer_count; ii++) {
|
for (u32 ii = 0; ii < offer_count; ii++) {
|
||||||
// TODO choose a system further away
|
// 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].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
|
// TODO compute based on distance between people and time_limit
|
||||||
state.map[i].offers[ii].offer = 1000 + (rand() % MAX_PASSENGER_JOB_PRICE);
|
state.map[i].offers[ii].offer = 1000 + (rand() % MAX_PASSENGER_JOB_PRICE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user