From c1f4368f75fecf30e1846e86a31b9d09735564e4 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 27 Feb 2016 05:42:46 +0100 Subject: Corrected return value for some BUILDIN() functions - The functions were returning `(bool)-1` instead of `false` in case of error, or `(bool)0` instead of `true` in case of success. Signed-off-by: Haru --- src/map/script.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index 9ad1064f4..f72176e50 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7305,7 +7305,7 @@ BUILDIN(getitem2) int get_count, i; memset(&item_tmp,0,sizeof(item_tmp)); if (item_data == NULL) - return -1; + return false; if(item_data->type==IT_WEAPON || item_data->type==IT_ARMOR) { ref = cap_value(ref, 0, MAX_REFINE); } @@ -13912,7 +13912,7 @@ BUILDIN(movenpc) y = script_getnum(st,4); if ((nd = npc->name2id(npc_name)) == NULL) - return -1; + return false; if (script_hasdata(st,5)) nd->dir = script_getnum(st,5) % 8; @@ -16344,7 +16344,7 @@ BUILDIN(getmonsterinfo) script_pushconststr(st,"null"); else script_pushint(st,-1); - return -1; + return false; } monster = mob->db(mob_id); switch ( script_getnum(st,3) ) { @@ -19640,7 +19640,7 @@ BUILDIN(countbound) } script_pushint(st,j); - return 0; + return true; } /*========================================== -- cgit v1.2.3-70-g09d2