diff options
author | Nipun Garg | 2019-06-19 01:17:25 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:49 +0200 |
commit | 4a76522283a1526199e6ee3bd10a3a3bfe6f07ef (patch) | |
tree | a7f472dcae5220e53b678f600bd3cfd57d642e8a /engines | |
parent | 0047051e18d8285d6ee377db61af11b838d827fd (diff) | |
download | scummvm-rg350-4a76522283a1526199e6ee3bd10a3a3bfe6f07ef.tar.gz scummvm-rg350-4a76522283a1526199e6ee3bd10a3a3bfe6f07ef.tar.bz2 scummvm-rg350-4a76522283a1526199e6ee3bd10a3a3bfe6f07ef.zip |
HDB: Complete cineSetEntity and setEntity stubs
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/lua-script.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index b94923da13..4f0371f03a 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -211,7 +211,15 @@ static int cineUseEntity(lua_State *L) { } static int cineSetEntity(lua_State *L) { - warning("STUB: CINE SET ENTITY"); + const char *entName = lua_tostring(L, 1); + double x = lua_tonumber(L, 2); + double y = lua_tonumber(L, 3); + double level = lua_tonumber(L, 4); + + g_hdb->_lua->checkParameters("cineSetEntity", 4); + + lua_pop(L, 4); + g_hdb->_ai->cineSetEntity(entName, (int)x, (int)y, (int)level); return 0; } @@ -321,7 +329,28 @@ static int getEntityXY(lua_State *L) { } static int setEntity(lua_State *L) { - warning("STUB: SET ENTITY"); + AIEntity *e = NULL; + + const char *entName = lua_tostring(L, 1); + double x = lua_tonumber(L, 2); + double y = lua_tonumber(L, 3); + double level = lua_tonumber(L, 4); + + g_hdb->_lua->checkParameters("setEntity", 4); + + lua_pop(L, 4); + warning("STUB: LuaScript setEntity: locateEntity needed"); + if (e) { + e->x = (int)x * kTileWidth; + e->tileX = (int)x; + e->y = (int)y * kTileHeight; + e->tileY = (int)y; + e->level = (int)level; + e->goalX = e->goalY = e->xVel = e->yVel = 0; + e->state = STATE_STANDDOWN; + } else { + warning("Could'nt SetEntity on '%s'", entName); + } return 0; } |