Skip to content

Commit b6fc15b

Browse files
committed
Adjusted several nested counter increments
1 parent 26daeb3 commit b6fc15b

File tree

3 files changed

+32
-38
lines changed

3 files changed

+32
-38
lines changed

ttyd-tools/rel/source/draw.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,19 +1974,18 @@ void drawBattlesStatusesList()
19741974

19751975
// Get the initial address offset
19761976
uint32_t DisplayValueCounter = 0;
1977-
if (IndexStart >= 1) // Sleep flags
1977+
1978+
if (IndexStart >= 20) // Explosion turns left
1979+
{
1980+
DisplayValueCounter += 3;
1981+
}
1982+
else if (IndexStart >= 18) // Can't use items
1983+
{
1984+
DisplayValueCounter += 2;
1985+
}
1986+
else if (IndexStart >= 1) // Sleep flags
19781987
{
19791988
DisplayValueCounter++;
1980-
1981-
if (IndexStart >= 18) // Can't use items
1982-
{
1983-
DisplayValueCounter++;
1984-
1985-
if (IndexStart >= 20) // Explosion turns left
1986-
{
1987-
DisplayValueCounter++;
1988-
}
1989-
}
19901989
}
19911990

19921991
// Draw the text and icons

ttyd-tools/rel/source/menu.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,19 +2562,17 @@ void menuCheckButton()
25622562
}
25632563

25642564
uint32_t Counter = 0;
2565-
if (tempCurrentMenuOption >= 1) // Sleep flags
2565+
if (tempCurrentMenuOption >= 20) // Explosion turns left
2566+
{
2567+
Counter += 3;
2568+
}
2569+
else if (tempCurrentMenuOption >= 18) // Can't use items
2570+
{
2571+
Counter += 2;
2572+
}
2573+
else if (tempCurrentMenuOption >= 1) // Sleep flags
25662574
{
25672575
Counter++;
2568-
2569-
if (tempCurrentMenuOption >= 18) // Can't use items
2570-
{
2571-
Counter++;
2572-
2573-
if (tempCurrentMenuOption >= 20) // Explosion turns left
2574-
{
2575-
Counter++;
2576-
}
2577-
}
25782576
}
25792577

25802578
uint32_t TotalOptions = BattlesStatusesLinesSize;

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,24 +2958,21 @@ const char *getMapFromIndex(int32_t index)
29582958
int32_t NewIndex = index - 1;
29592959
uint32_t Counter = 0;
29602960

2961-
if (NewIndex >= 74) // gon_bt00
2961+
if (NewIndex >= 269) // dig_00
2962+
{
2963+
Counter += 32;
2964+
}
2965+
else if (NewIndex >= 266) // qiz_00
2966+
{
2967+
Counter += 24;
2968+
}
2969+
else if (NewIndex >= 90) // hei_bt00
2970+
{
2971+
Counter += 16;
2972+
}
2973+
else if (NewIndex >= 74) // gon_bt00
29622974
{
29632975
Counter += 8;
2964-
2965-
if (NewIndex >= 90) // hei_bt00
2966-
{
2967-
Counter += 8;
2968-
2969-
if (NewIndex >= 266) // qiz_00
2970-
{
2971-
Counter += 8;
2972-
2973-
if (NewIndex >= 269) // dig_00
2974-
{
2975-
Counter += 8;
2976-
}
2977-
}
2978-
}
29792976
}
29802977

29812978
uint32_t WorldDataPointer = reinterpret_cast<uint32_t>(ttyd::mapdata::worldData.unk_18);

0 commit comments

Comments
 (0)