From 79be5133dcda12d20934faf32a7f71e6c7de0e78 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Tue, 10 Jan 2012 01:52:39 +0100 Subject: Made the lua item_drop script function returns whether it succeeded. Part of Mana-Mantis #339. Reviewed-by: Ablu --- src/scripting/lua.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 26de371c..f681133f 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -2214,8 +2214,9 @@ static int is_walkable(lua_State *s) } /** - * mana.drop_item(int x, int y, int id || string name[, int number]): void + * mana.drop_item(int x, int y, int id || string name[, int number]): bool * Creates an item stack on the floor. + * @Returns whether the insertion was successful. */ static int item_drop(lua_State *s) { @@ -2244,9 +2245,8 @@ static int item_drop(lua_State *s) i->setMap(map); Point pos(x, y); i->setPosition(pos); - GameState::insertOrDelete(i); - - return 0; + lua_pushboolean(s, GameState::insertOrDelete(i)); + return 1; } /** -- cgit v1.2.3-60-g2f50