aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/ai-lists.cpp2
-rw-r--r--engines/hdb/lua-script.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp
index d2ddd4ae3a..d6534cc6cf 100644
--- a/engines/hdb/ai-lists.cpp
+++ b/engines/hdb/ai-lists.cpp
@@ -816,6 +816,8 @@ ArrowPath *AI::findArrowPath(int x, int y) {
void AI::addToTriggerList(char *luaFuncInit, char *luaFuncUse, int x, int y, int value1, int value2, char *id) {
Trigger *t = new Trigger;
+ _triggerList->push_back(t);
+
strcpy(t->id, id);
t->x = x;
t->y = y;
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index 02bf16ca50..bffb7856d2 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -1494,7 +1494,10 @@ void LuaScript::call(int args, int returns) {
if (!_systemInit)
return;
- lua_call(_state, args, returns);
+ if (lua_pcall(_state, args, returns, -2)) {
+ error("An error occured while executing: %s.", lua_tostring(_state, -1));
+ lua_pop(_state, -1);
+ }
}
bool LuaScript::callFunction(const char *name, int returns) {