mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
update component 'ARGS' variable default value
This commit is contained in:
parent
a2f79e979e
commit
10fa828bd7
3 changed files with 5 additions and 3 deletions
|
|
@ -8,7 +8,6 @@ inair = true
|
||||||
ready = false
|
ready = false
|
||||||
target = -1
|
target = -1
|
||||||
|
|
||||||
ARGS = ARGS or {}
|
|
||||||
local dropitem = ARGS
|
local dropitem = ARGS
|
||||||
if SAVED_DATA.item then
|
if SAVED_DATA.item then
|
||||||
dropitem.id = item.index(SAVED_DATA.item)
|
dropitem.id = item.index(SAVED_DATA.item)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ local tsf = entity.transform
|
||||||
local body = entity.rigidbody
|
local body = entity.rigidbody
|
||||||
local rig = entity.skeleton
|
local rig = entity.skeleton
|
||||||
|
|
||||||
ARGS = ARGS or {}
|
|
||||||
local blockid = ARGS.block
|
local blockid = ARGS.block
|
||||||
if SAVED_DATA.block then
|
if SAVED_DATA.block then
|
||||||
blockid = SAVED_DATA.block
|
blockid = SAVED_DATA.block
|
||||||
|
|
|
||||||
|
|
@ -334,9 +334,13 @@ void scripting::on_entity_spawn(
|
||||||
util::replaceAll(compfieldname, ":", "__");
|
util::replaceAll(compfieldname, ":", "__");
|
||||||
if (auto datamap = args->map(compfieldname)) {
|
if (auto datamap = args->map(compfieldname)) {
|
||||||
lua::pushvalue(L, datamap);
|
lua::pushvalue(L, datamap);
|
||||||
lua::setfield(L, "ARGS");
|
} else {
|
||||||
|
lua::createtable(L, 0, 0);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
lua::createtable(L, 0, 0);
|
||||||
}
|
}
|
||||||
|
lua::setfield(L, "ARGS");
|
||||||
|
|
||||||
if (saved == nullptr) {
|
if (saved == nullptr) {
|
||||||
lua::createtable(L, 0, 0);
|
lua::createtable(L, 0, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue