summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-27 05:42:46 +0100
committerHaru <haru@dotalux.com>2016-02-27 14:30:02 +0100
commitc1f4368f75fecf30e1846e86a31b9d09735564e4 (patch)
treeb7d9c668e7141c77c62e202d13da19a91581abad /src/map/script.c
parent654975dab8c0e47f3523745bfee4abecf8ab0b30 (diff)
downloadhercules-c1f4368f75fecf30e1846e86a31b9d09735564e4.tar.gz
hercules-c1f4368f75fecf30e1846e86a31b9d09735564e4.tar.bz2
hercules-c1f4368f75fecf30e1846e86a31b9d09735564e4.tar.xz
hercules-c1f4368f75fecf30e1846e86a31b9d09735564e4.zip
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 <haru@dotalux.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c8
1 files changed, 4 insertions, 4 deletions
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;
}
/*==========================================