From d97565e4e02ab6499fffd757814f6cc08fadf36f Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 3 Aug 2020 13:52:41 -0300 Subject: [PATCH] [lua] Fix app.command.SetInkType{ type=... } Related to https://community.aseprite.org/t/6532/3 --- src/app/commands/new_params.cpp | 2 +- src/app/context.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/commands/new_params.cpp b/src/app/commands/new_params.cpp index a60becfc5..1281b52b7 100644 --- a/src/app/commands/new_params.cpp +++ b/src/app/commands/new_params.cpp @@ -345,7 +345,7 @@ void Param::fromLua(lua_State* L, int index) template<> void Param::fromLua(lua_State* L, int index) { - script::get_value_from_lua(L, index); + setValue(script::get_value_from_lua(L, index)); } void CommandWithNewParamsBase::loadParamsFromLuaTable(lua_State* L, int index) diff --git a/src/app/context.cpp b/src/app/context.cpp index 3a62da3e7..078dd9126 100644 --- a/src/app/context.cpp +++ b/src/app/context.cpp @@ -148,7 +148,11 @@ void Context::executeCommand(Command* command, const Params& params) try { m_flags.update(this); +#if 0 + // params.empty() can be empty when we call the command from Lua + // with a table. ASSERT(!command->needsParams() || !params.empty()); +#endif command->loadParams(params);