mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
level-select.c: Fix incorrect responses for level-finding functions
- Fix the case where invalid levelsearch_t were providing values of false instead of NEXTMAP_INVALID - Fix the case where M_GetFirstLevelInList was not returning NEXTMAP_INVALID for rearching nummapheaders
This commit is contained in:
parent
756feaa20b
commit
b5be97cbfc
1 changed files with 6 additions and 3 deletions
|
|
@ -98,7 +98,7 @@ UINT16 M_CountLevelsToShowInList(levelsearch_t *levelsearch)
|
||||||
INT16 i, count = 0;
|
INT16 i, count = 0;
|
||||||
|
|
||||||
if (!levelsearch)
|
if (!levelsearch)
|
||||||
return false;
|
return 0;
|
||||||
|
|
||||||
if (levelsearch->cup)
|
if (levelsearch->cup)
|
||||||
{
|
{
|
||||||
|
|
@ -127,7 +127,7 @@ UINT16 M_GetFirstLevelInList(UINT8 *i, levelsearch_t *levelsearch)
|
||||||
INT16 mapnum = NEXTMAP_INVALID;
|
INT16 mapnum = NEXTMAP_INVALID;
|
||||||
|
|
||||||
if (!levelsearch)
|
if (!levelsearch)
|
||||||
return false;
|
return NEXTMAP_INVALID;
|
||||||
|
|
||||||
if (levelsearch->cup)
|
if (levelsearch->cup)
|
||||||
{
|
{
|
||||||
|
|
@ -152,6 +152,9 @@ UINT16 M_GetFirstLevelInList(UINT8 *i, levelsearch_t *levelsearch)
|
||||||
for (mapnum = 0; mapnum < nummapheaders; mapnum++)
|
for (mapnum = 0; mapnum < nummapheaders; mapnum++)
|
||||||
if (M_CanShowLevelInList(mapnum, levelsearch))
|
if (M_CanShowLevelInList(mapnum, levelsearch))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (mapnum >= nummapheaders)
|
||||||
|
mapnum = NEXTMAP_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mapnum;
|
return mapnum;
|
||||||
|
|
@ -160,7 +163,7 @@ UINT16 M_GetFirstLevelInList(UINT8 *i, levelsearch_t *levelsearch)
|
||||||
UINT16 M_GetNextLevelInList(UINT16 mapnum, UINT8 *i, levelsearch_t *levelsearch)
|
UINT16 M_GetNextLevelInList(UINT16 mapnum, UINT8 *i, levelsearch_t *levelsearch)
|
||||||
{
|
{
|
||||||
if (!levelsearch)
|
if (!levelsearch)
|
||||||
return false;
|
return NEXTMAP_INVALID;
|
||||||
|
|
||||||
if (levelsearch->cup)
|
if (levelsearch->cup)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue