Fix tangible.build

This commit is contained in:
2021-11-23 14:22:12 -05:00
parent 286c4bc1f1
commit b5a66a6000
3 changed files with 12 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ LuaDefine(tangible_animate, "c") {
int64_t id = w->alloc_id_predictable();
const AnimStep &prev = tan->anim_queue_.back();
AnimStep step;
step.from_lua(L, config.index(), prev);
step.from_lua(L, config.index(), false, prev);
if (step.action() == "") {
luaL_error(L, "animation action must be specified");
}
@@ -74,14 +74,18 @@ LuaDefine(tangible_build, "c") {
LS.checktable(config);
// Get the class of the new tangible.
LS.rawget(classname, config, "class");
if (LS.isnil(classname)) {
luaL_error(L, "must specify a class name");
} else if (LS.classname(classname) != "") {
LS.set(classtab, classname);
} else {
LS.getclass(classtab, classname);
}
LS.getclass(classtab, classname);
// Parse the initial animation step.
AnimStep initstep, blank;
initstep.from_lua(L, config.index(), blank);
initstep.from_lua(L, config.index(), true, blank);
if (!initstep.has_xyz()) {
luaL_error(L, "You must specify (X,Y,Z) for new tangible");
}