diff options
author | Nipun Garg | 2019-07-01 09:03:30 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:06 +0200 |
commit | c4dbb0967515852d87987baba2af5f7273e70aaa (patch) | |
tree | 2f276aeae6ee4d7aa803b4ccab3238f4d01846b0 /engines | |
parent | 016e0baca8bbdb6e172c3731da0b88beef3b934c (diff) | |
download | scummvm-rg350-c4dbb0967515852d87987baba2af5f7273e70aaa.tar.gz scummvm-rg350-c4dbb0967515852d87987baba2af5f7273e70aaa.tar.bz2 scummvm-rg350-c4dbb0967515852d87987baba2af5f7273e70aaa.zip |
HDB: Add Lua functions for Deliveries
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/lua-script.cpp | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 2a3b032ec6..031ce55501 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -428,18 +428,39 @@ static int cineCenterTextOut(lua_State *L) { } static int newDelivery(lua_State *L) { - warning("STUB: NEW DELIVERY"); + const char *itemTextName, *itemGfxName; + const char *destTextName, *destGfxName, *id; + + itemTextName = lua_tostring(L, 1); + itemGfxName = lua_tostring(L, 2); + destTextName = lua_tostring(L, 3); + destGfxName = lua_tostring(L, 4); + id = lua_tostring(L, 5); + + g_hdb->_lua->checkParameters("newDelivery", 5); + + lua_pop(L, 5); + + g_hdb->_ai->newDelivery(itemTextName, itemGfxName, destTextName, destGfxName, id); + return 0; } static int completeDelivery(lua_State *L) { - warning("STUB: COMPLETE DELIVERY"); - return 0; + const char *id = lua_tostring(L, 1); + double rtn = g_hdb->_ai->completeDelivery(id); + + g_hdb->_lua->checkParameters("completeDelivery", 1); + + lua_pop(L, 1); + lua_pushnumber(L, rtn); + return 1; } static int deliveriesLeft(lua_State *L) { - warning("STUB: DELIVERIES LEFT"); - return 0; + double value = (double)g_hdb->_ai->getDeliveriesAmount(); + lua_pushnumber(L, value); + return 1; } static int getEntityXY(lua_State *L) { |