Fix tangible.build
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user