fix: player.set_suspend(pid, true) leaves entity in the world

This commit is contained in:
MihailRis 2026-01-09 02:00:54 +03:00
parent e051921a56
commit a4fc4a5044

View file

@ -324,8 +324,10 @@ static int l_is_suspended(lua::State* L) {
} }
static int l_set_suspended(lua::State* L) { static int l_set_suspended(lua::State* L) {
if (auto player = get_player(L, 1)) { if (lua::toboolean(L, 2)) {
player->setSuspended(lua::toboolean(L, 2)); level->players->suspend(lua::tointeger(L, 1));
} else {
level->players->resume(lua::tointeger(L, 1));
} }
return 0; return 0;
} }