mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
feat: player.delete() function and update documentation
This commit is contained in:
parent
c1b311f3c4
commit
13c36f4629
6 changed files with 38 additions and 0 deletions
|
|
@ -279,6 +279,11 @@ static int l_create(lua::State* L) {
|
|||
return lua::pushinteger(L, player->getId());
|
||||
}
|
||||
|
||||
static int l_delete(lua::State* L) {
|
||||
level->players->remove(lua::tointeger(L, 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg playerlib[] = {
|
||||
{"get_pos", lua::wrap<l_get_pos>},
|
||||
{"set_pos", lua::wrap<l_set_pos>},
|
||||
|
|
@ -310,5 +315,6 @@ const luaL_Reg playerlib[] = {
|
|||
{"get_name", lua::wrap<l_get_name>},
|
||||
{"set_name", lua::wrap<l_set_name>},
|
||||
{"create", lua::wrap<l_create>},
|
||||
{"delete", lua::wrap<l_delete>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue