From d2bfd8012b6321959edb92d61b8bbbdaddfe3eb6 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Mon, 27 Feb 2023 15:53:46 +0300 Subject: [PATCH] Review PrintAMelevList Closes #49 --- src/game/pipboy.cc | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/game/pipboy.cc b/src/game/pipboy.cc index 04ae5f6..43a3a46 100644 --- a/src/game/pipboy.cc +++ b/src/game/pipboy.cc @@ -1587,21 +1587,16 @@ static int PrintAMelevList(int a1) } } - for (int map = 0; map < 5; map++) { - if (map == amcty_indx) { - continue; - } - - if (get_map_idx_same(amcty_indx, map) == -1) { - continue; - } - - for (int elevation = 0; elevation < ELEVATION_COUNT; elevation++) { - if (automapHeader->offsets[map][elevation] > 0) { - sortlist[line].name = map_get_elev_idx(map, elevation); - sortlist[line].value = elevation; - sortlist[line].field_6 = map; - line++; + for (int index = 0; index < 5; index++) { + int map = get_map_idx_same(amcty_indx, index); + if (map != -1) { + for (int elevation = 0; elevation < ELEVATION_COUNT; elevation++) { + if (automapHeader->offsets[map][elevation] > 0) { + sortlist[line].name = map_get_elev_idx(map, elevation); + sortlist[line].value = elevation; + sortlist[line].field_6 = map; + line++; + } } } }