summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/ElementConvertors/CommandConvertor.cpp')
-rw-r--r--Sluift/ElementConvertors/CommandConvertor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Sluift/ElementConvertors/CommandConvertor.cpp b/Sluift/ElementConvertors/CommandConvertor.cpp
index 7fb7b22..9a2aa5f 100644
--- a/Sluift/ElementConvertors/CommandConvertor.cpp
+++ b/Sluift/ElementConvertors/CommandConvertor.cpp
@@ -157,39 +157,40 @@ void CommandConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Command> p
Lua::Table noteTable;
if (!note.note.empty()) {
noteTable["note"] = Lua::valueRef(note.note);
}
switch (note.type) {
case Command::Note::Info: noteTable["type"] = Lua::valueRef("info"); break;
case Command::Note::Warn: noteTable["type"] = Lua::valueRef("warn"); break;
case Command::Note::Error: noteTable["type"] = Lua::valueRef("error"); break;
}
notes.push_back(noteTable);
}
result["notes"] = Lua::valueRef(notes);
}
if (payload->getAction() != Command::NoAction) {
result["action"] = Lua::valueRef(convertActionToString(payload->getAction()));
}
if (payload->getExecuteAction() != Command::NoAction) {
result["execute_action"] = Lua::valueRef(convertActionToString(payload->getAction()));
}
if (!payload->getAvailableActions().empty()) {
std::vector<Lua::Value> availableActions;
foreach (const Command::Action& action, payload->getAvailableActions()) {
if (action != Command::NoAction) {
availableActions.push_back(convertActionToString(action));
}
}
result["available_actions"] = Lua::valueRef(availableActions);
}
Lua::pushValue(L, result);
if (payload->getForm()) {
- convertors->convertToLuaUntyped(L, payload->getForm());
+ bool result = convertors->convertToLuaUntyped(L, payload->getForm());
+ assert(result);
lua_setfield(L, -2, "form");
}
}