mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add component ARGS variable
This commit is contained in:
parent
da6b014d62
commit
1b41a75cf4
6 changed files with 24 additions and 7 deletions
|
|
@ -31,7 +31,11 @@ static int l_spawn(lua::State* L) {
|
|||
auto defname = lua::tostring(L, 1);
|
||||
auto& def = content->entities.require(defname);
|
||||
auto pos = lua::tovec3(L, 2);
|
||||
level->entities->spawn(def, pos);
|
||||
dynamic::Value args = dynamic::NONE;
|
||||
if (lua::gettop(L) > 2) {
|
||||
args = lua::tovalue(L, 3);
|
||||
}
|
||||
level->entities->spawn(def, pos, args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue