mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: player.set_suspend(pid, true) leaves entity in the world
This commit is contained in:
parent
e051921a56
commit
a4fc4a5044
1 changed files with 4 additions and 2 deletions
|
|
@ -324,8 +324,10 @@ static int l_is_suspended(lua::State* L) {
|
|||
}
|
||||
|
||||
static int l_set_suspended(lua::State* L) {
|
||||
if (auto player = get_player(L, 1)) {
|
||||
player->setSuspended(lua::toboolean(L, 2));
|
||||
if (lua::toboolean(L, 2)) {
|
||||
level->players->suspend(lua::tointeger(L, 1));
|
||||
} else {
|
||||
level->players->resume(lua::tointeger(L, 1));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue