mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Invalidate player.itemroulette.itemlist in LUA_InvalidatePlayer when applicable
This commit is contained in:
parent
4d14f76e16
commit
b082816278
2 changed files with 4 additions and 0 deletions
|
|
@ -228,6 +228,9 @@ static int itemrouletteitemlist_get(lua_State *L)
|
||||||
itemlist_t *itemlist = *((itemlist_t **)luaL_checkudata(L, 1, META_ITEMROULETTE_ITEMLIST));
|
itemlist_t *itemlist = *((itemlist_t **)luaL_checkudata(L, 1, META_ITEMROULETTE_ITEMLIST));
|
||||||
size_t index = luaL_checkint(L, 2);
|
size_t index = luaL_checkint(L, 2);
|
||||||
|
|
||||||
|
if (!itemlist)
|
||||||
|
return LUA_ErrInvalid(L, "itemroulette_t.itemlist_t");
|
||||||
|
|
||||||
if (index == 0 || index > itemlist->len) {
|
if (index == 0 || index > itemlist->len) {
|
||||||
return luaL_error(L, LUA_QL("itemroulette_t.itemlist_t") " index cannot be %d", index);
|
return luaL_error(L, LUA_QL("itemroulette_t.itemlist_t") " index cannot be %d", index);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -892,6 +892,7 @@ void LUA_InvalidatePlayer(player_t *player)
|
||||||
LUA_InvalidateUserdata(player);
|
LUA_InvalidateUserdata(player);
|
||||||
LUA_InvalidateUserdata(player->karthud);
|
LUA_InvalidateUserdata(player->karthud);
|
||||||
LUA_InvalidateUserdata(&player->cmd);
|
LUA_InvalidateUserdata(&player->cmd);
|
||||||
|
LUA_InvalidateUserdata(&player->itemRoulette.itemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue