Make the Lua interface return/set the first tags from the local taglists.

This commit is contained in:
Nev3r 2020-04-17 22:30:16 +02:00
parent 36d6bbd42a
commit 95146cfdab
2 changed files with 5 additions and 5 deletions

View file

@ -537,7 +537,7 @@ static int sector_get(lua_State *L)
lua_pushinteger(L, sector->special); lua_pushinteger(L, sector->special);
return 1; return 1;
case sector_tag: case sector_tag:
lua_pushinteger(L, sector->tag); lua_pushinteger(L, Tag_FGet(&sector->tags));
return 1; return 1;
case sector_thinglist: // thinglist case sector_thinglist: // thinglist
lua_pushcfunction(L, lib_iterateSectorThinglist); lua_pushcfunction(L, lib_iterateSectorThinglist);
@ -636,7 +636,7 @@ static int sector_set(lua_State *L)
sector->special = (INT16)luaL_checkinteger(L, 3); sector->special = (INT16)luaL_checkinteger(L, 3);
break; break;
case sector_tag: case sector_tag:
P_ChangeSectorTag((UINT32)(sector - sectors), (INT16)luaL_checkinteger(L, 3)); Tag_SectorFSet((UINT32)(sector - sectors), (INT16)luaL_checkinteger(L, 3));
break; break;
} }
return 0; return 0;
@ -770,7 +770,7 @@ static int line_get(lua_State *L)
lua_pushinteger(L, line->special); lua_pushinteger(L, line->special);
return 1; return 1;
case line_tag: case line_tag:
lua_pushinteger(L, line->tag); lua_pushinteger(L, Tag_FGet(&line->tags));
return 1; return 1;
case line_args: case line_args:
LUA_PushUserdata(L, line->args, META_LINEARGS); LUA_PushUserdata(L, line->args, META_LINEARGS);

View file

@ -780,7 +780,7 @@ static int mapthing_get(lua_State *L)
else if(fastcmp(field,"extrainfo")) else if(fastcmp(field,"extrainfo"))
number = mt->extrainfo; number = mt->extrainfo;
else if(fastcmp(field,"tag")) else if(fastcmp(field,"tag"))
number = mt->tag; number = Tag_FGet(&mt->tags);
else if(fastcmp(field,"mobj")) { else if(fastcmp(field,"mobj")) {
LUA_PushUserdata(L, mt->mobj, META_MOBJ); LUA_PushUserdata(L, mt->mobj, META_MOBJ);
return 1; return 1;
@ -824,7 +824,7 @@ static int mapthing_set(lua_State *L)
mt->extrainfo = (UINT8)extrainfo; mt->extrainfo = (UINT8)extrainfo;
} }
else if (fastcmp(field,"tag")) else if (fastcmp(field,"tag"))
mt->tag = (INT16)luaL_checkinteger(L, 3); Tag_FSet(&mt->tags, (INT16)luaL_checkinteger(L, 3));
else if(fastcmp(field,"mobj")) else if(fastcmp(field,"mobj"))
mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ)); mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
else else