Clean up v1 UB for G_BuildMapName Lua
This commit is contained in:
parent
46ab8191f7
commit
b17601c1a5
1 changed files with 2 additions and 2 deletions
|
|
@ -3330,9 +3330,9 @@ static int lib_gBuildMapName(lua_State *L)
|
|||
{
|
||||
INT32 map = Lcheckmapnumber(L, 1, "G_BuildMapName");
|
||||
|
||||
if (lua_compatmode) // v1 has undefined behaviour if you return 0, who knew.
|
||||
if (lua_compatmode && map == 0) // v1 has undefined behaviour if you return 0, who knew.
|
||||
{
|
||||
map = map == 0 ? G_RandMap(G_TOLFlag(gametype), gamemap-1, 0, 0, NULL) + 1 : map;
|
||||
map = G_NativeMapToKart(G_RandMap(G_TOLFlag(gametype), gamemap-1, 0, 0, NULL) + 1);
|
||||
}
|
||||
|
||||
//HUDSAFE
|
||||
|
|
|
|||
Loading…
Reference in a new issue