mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-29 15:42:03 +00:00
Ensure extracolormap_t is valid and that extra_colormap is invalidated
This commit is contained in:
parent
eb3129490f
commit
5bbcffe6f9
2 changed files with 8 additions and 0 deletions
|
@ -116,6 +116,9 @@ static int extracolormap_get(lua_State *L)
|
|||
extracolormap_t *exc = *((extracolormap_t **)luaL_checkudata(L, 1, META_EXTRACOLORMAP));
|
||||
enum extracolormap_e field = luaL_checkoption(L, 2, NULL, extracolormap_opt);
|
||||
|
||||
if (!exc)
|
||||
return LUA_ErrInvalid(L, "extracolormap_t");
|
||||
|
||||
switch (field)
|
||||
{
|
||||
case extracolormap_red:
|
||||
|
@ -198,6 +201,9 @@ static int extracolormap_set(lua_State *L)
|
|||
extracolormap_t *exc = *((extracolormap_t **)luaL_checkudata(L, 1, META_EXTRACOLORMAP));
|
||||
enum extracolormap_e field = luaL_checkoption(L, 2, NULL, extracolormap_opt);
|
||||
|
||||
if (!exc)
|
||||
return LUA_ErrInvalid(L, "extracolormap_t");
|
||||
|
||||
UINT8 r = R_GetRgbaR(exc->rgba);
|
||||
UINT8 g = R_GetRgbaG(exc->rgba);
|
||||
UINT8 b = R_GetRgbaB(exc->rgba);
|
||||
|
|
|
@ -892,6 +892,8 @@ void LUA_InvalidateLevel(void)
|
|||
LUA_InvalidateUserdata(§ors[i]);
|
||||
LUA_InvalidateUserdata(§ors[i].lines);
|
||||
LUA_InvalidateUserdata(§ors[i].tags);
|
||||
if (sectors[i].extra_colormap)
|
||||
LUA_InvalidateUserdata(sectors[i].extra_colormap);
|
||||
if (sectors[i].ffloors)
|
||||
{
|
||||
for (rover = sectors[i].ffloors; rover; rover = rover->next)
|
||||
|
|
Loading…
Reference in a new issue