diff options
| -rw-r--r-- | src/scenes/world_map.c | 1 | ||||
| -rw-r--r-- | src/world.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/scenes/world_map.c b/src/scenes/world_map.c index 2640d47..70be8c3 100644 --- a/src/scenes/world_map.c +++ b/src/scenes/world_map.c @@ -1180,6 +1180,7 @@ static void world_map_draw_bank(platform_window* window) sprintf(txt, "LOAN: 150K at $%.0f/month. %d days left.",
_active_world->bank_info.loan3.monthly_payment, _active_world->bank_info.loan3.days_left);
renderer->render_text(fnt_big, btn_row_x + textpad, btn_row_y + textpad + txt_offset, txt, COLOR_TEXT);
+ txt_offset += fnt_big->px_h + textpad;
}
if (txt_offset == 0) {
diff --git a/src/world.c b/src/world.c index 6d62b09..111b3a3 100644 --- a/src/world.c +++ b/src/world.c @@ -1216,11 +1216,14 @@ static world_location* get_random_owned_location(world* world) s32 rand_nr = get_random_number(0, count);
+ count = 0;
for (s32 i = 0; i < world->locations.length; i++)
{
world_location* location = array_at(&world->locations, i);
if (!location->is_owned) continue;
- if (i == rand_nr) return location;
+ count++;
+
+ if (count == rand_nr) return location;
}
return 0;
}
|
