summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-27 05:24:02 +0100
committerHaru <haru@dotalux.com>2016-02-27 14:30:02 +0100
commit654975dab8c0e47f3523745bfee4abecf8ab0b30 (patch)
tree0460bd654e9e90823c957667bdd83e9ceea5389b /src/map/mob.c
parent33d37ff161f724b0bbcde4eedf32c528d3576c90 (diff)
downloadhercules-654975dab8c0e47f3523745bfee4abecf8ab0b30.tar.gz
hercules-654975dab8c0e47f3523745bfee4abecf8ab0b30.tar.bz2
hercules-654975dab8c0e47f3523745bfee4abecf8ab0b30.tar.xz
hercules-654975dab8c0e47f3523745bfee4abecf8ab0b30.zip
Replaced various '-1' with the correct constant
INFINITE_DURATION, INVALID_TIMER, SC_NONE, INDEX_NOT_FOUND, depending on context. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index b2f52f634..063a1ff6e 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2987,18 +2987,20 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,uint16 skill_id)
/*==========================================
* MOBskill lookup (get skillindex through skill_id)
- * Returns -1 if not found.
+ * Returns INDEX_NOT_FOUND if not found.
*------------------------------------------*/
int mob_skill_id2skill_idx(int class_,uint16 skill_id)
{
int i, max = mob->db(class_)->maxskill;
struct mob_skill *ms=mob->db(class_)->skill;
- if(ms==NULL)
- return -1;
+ if (ms == NULL)
+ return INDEX_NOT_FOUND;
- ARR_FIND( 0, max, i, ms[i].skill_id == skill_id );
- return ( i < max ) ? i : -1;
+ ARR_FIND(0, max, i, ms[i].skill_id == skill_id);
+ if (i == max)
+ return INDEX_NOT_FOUND;
+ return i;
}
/*==========================================