Expose `player.skin` and `player.availabilities` to Lua as Read-only

This commit is contained in:
SMS Alfredo 2020-11-25 12:35:36 -06:00
parent 50e15840fb
commit b2d6d4f83f
1 changed files with 8 additions and 0 deletions

View File

@ -158,6 +158,10 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->flashpal);
else if (fastcmp(field,"skincolor"))
lua_pushinteger(L, plr->skincolor);
else if (fastcmp(field,"skin"))
lua_pushinteger(L, plr->skin);
else if (fastcmp(field,"availabilities"))
lua_pushinteger(L, plr->availabilities);
else if (fastcmp(field,"score"))
lua_pushinteger(L, plr->score);
else if (fastcmp(field,"dashspeed"))
@ -469,6 +473,10 @@ static int player_set(lua_State *L)
return luaL_error(L, "player.skincolor %d out of range (0 - %d).", newcolor, numskincolors-1);
plr->skincolor = newcolor;
}
else if (fastcmp(field,"skin"))
return NOSET;
else if (fastcmp(field,"availabilities"))
return NOSET;
else if (fastcmp(field,"score"))
plr->score = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"dashspeed"))