mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add ENTITY_NONE, ENTITY_AUTO reserved entity id & update player.set_entity(...)
This commit is contained in:
parent
f2101f6504
commit
23c66654a2
4 changed files with 7 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue