mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Use correct type for unlock IDs in loading
This commit is contained in:
parent
1b3c63f24a
commit
49f644d5e9
2 changed files with 3 additions and 10 deletions
|
|
@ -483,15 +483,8 @@ void srb2::load_ng_gamedata()
|
||||||
PU_STATIC, NULL));
|
PU_STATIC, NULL));
|
||||||
for (size_t i = 0; i < std::min((size_t)(gamedata->challengegridwidth * CHALLENGEGRIDHEIGHT), js.challengegrid.grid.size()); i++)
|
for (size_t i = 0; i < std::min((size_t)(gamedata->challengegridwidth * CHALLENGEGRIDHEIGHT), js.challengegrid.grid.size()); i++)
|
||||||
{
|
{
|
||||||
int16_t gridvalue = js.challengegrid.grid[i];
|
uint16_t gridvalue = js.challengegrid.grid[i];
|
||||||
if (gridvalue < 0)
|
gamedata->challengegrid[i] = gridvalue;
|
||||||
{
|
|
||||||
gamedata->challengegrid[i] = MAXUNLOCKABLES;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gamedata->challengegrid[i] = static_cast<uint8_t>(gridvalue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
M_SanitiseChallengeGrid();
|
M_SanitiseChallengeGrid();
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ struct GamedataPrisonEggPickupsJson final
|
||||||
struct GamedataChallengeGridJson final
|
struct GamedataChallengeGridJson final
|
||||||
{
|
{
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
std::vector<int16_t> grid;
|
std::vector<uint16_t> grid;
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(GamedataChallengeGridJson, width, grid)
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(GamedataChallengeGridJson, width, grid)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue