aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-07-01 09:04:01 +0530
committerEugene Sandulenko2019-09-03 17:17:06 +0200
commite895a0929bd3acfccf8b3dd5a8eea617d629e04f (patch)
tree70319a60de3457cc9c026d8dbe2506edfb4e6ef5 /engines
parentc4dbb0967515852d87987baba2af5f7273e70aaa (diff)
downloadscummvm-rg350-e895a0929bd3acfccf8b3dd5a8eea617d629e04f.tar.gz
scummvm-rg350-e895a0929bd3acfccf8b3dd5a8eea617d629e04f.tar.bz2
scummvm-rg350-e895a0929bd3acfccf8b3dd5a8eea617d629e04f.zip
HDB: Add Lua function for setEntDir()
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/lua-script.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index 031ce55501..e8abd341be 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -505,7 +505,25 @@ static int setEntity(lua_State *L) {
}
static int setEntDir(lua_State *L) {
- warning("STUB: SET ENTITY DIR");
+ AIEntity *e;
+ char buff[64];
+
+ const char *entName = lua_tostring(L, 1);
+ double d = lua_tonumber(L, 2);
+
+ g_hdb->_lua->checkParameters("setEntDir", 2);
+
+ lua_pop(L, 2);
+ e = g_hdb->_ai->locateEntity(entName);
+
+ if (e) {
+ int dd = (int)d;
+ e->dir = (AIDir)dd;
+ } else {
+ sprintf(buff, "Could not SetEntDir on '%s'", entName);
+ g_hdb->_window->openMessageBar(buff, 10);
+ }
+
return 0;
}