Skip to content

Commit 4199489

Browse files
committed
Warp By Index - Changed the entrances to start at 1 instead of 0
1 parent 04a2611 commit 4199489

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

ttyd-tools/rel/include/global.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,11 @@ struct WarpByIndexStruct
619619
uint16_t MapId;
620620
uint8_t EntranceId;
621621
const char *EntranceList[32];
622+
623+
WarpByIndexStruct()
624+
{
625+
EntranceId = 1;
626+
}
622627
};
623628

624629
extern Menus Menu[27];

ttyd-tools/rel/source/codes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ uint32_t Mod::setIndexWarpEntrance(void *scriptContext, uint32_t waitMode)
14951495
WarpByIndex.RunIndexWarpCode = false;
14961496

14971497
// Make sure the chosen entrance exists for the chosen map
1498-
uint32_t ChosenEntrance = WarpByIndex.EntranceId;
1498+
uint32_t ChosenEntrance = WarpByIndex.EntranceId - 1;
14991499
const char *ChosenEntranceName;
15001500

15011501
if (ChosenEntrance < LoadingZoneTotal)

ttyd-tools/rel/source/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3228,7 +3228,7 @@ void drawWarpIndexEntranceList()
32283228
// Draw the entrance number
32293229
sprintf(tempDisplayBuffer,
32303230
"Entrance %" PRIu32,
3231-
i);
3231+
i + 1);
32323232

32333233
drawText(tempDisplayBuffer, PosX, PosY, Alpha, Color, Scale);
32343234

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,15 +571,15 @@ int32_t *getUpperAndLowerBounds(int32_t *tempArray, uint32_t currentMenu)
571571
}
572572
case WARPS_INDEX:
573573
{
574-
// LowerBound = 0;
575-
576574
if (tempCurrentMenuOption == INDEX_SELECT_MAP)
577575
{
576+
// LowerBound = 0;
578577
UpperBound = 271;
579578
}
580579
else
581580
{
582-
UpperBound = (sizeof(WarpByIndex.EntranceList) / sizeof(WarpByIndex.EntranceList[0])) - 1;
581+
LowerBound = 1;
582+
UpperBound = sizeof(WarpByIndex.EntranceList) / sizeof(WarpByIndex.EntranceList[0]);
583583
}
584584
break;
585585
}

0 commit comments

Comments
 (0)