add ENTITY_NONE, ENTITY_AUTO reserved entity id & update player.set_entity(...)

This commit is contained in:
MihailRis
2025-01-21 05:56:14 +03:00
parent f2101f6504
commit 23c66654a2
4 changed files with 7 additions and 4 deletions
+3 -1
View File
@@ -229,7 +229,9 @@ static int l_set_entity(lua::State* L) {
if (player == nullptr) {
return 0;
}
if (auto entity = get_entity(L, 2)) {
if (lua::isnumber(L, 2)) {
player->setEntity(lua::tointeger(L, 2));
} else if (auto entity = get_entity(L, 2)) {
player->setEntity(entity->getUID());
}
return 0;