summaryrefslogtreecommitdiff
path: root/src/map/homunculus.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/homunculus.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/homunculus.c')
-rw-r--r--src/map/homunculus.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index d10cea64a..bda8fd9e6 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -399,7 +399,7 @@ bool homunculus_levelup(struct homun_data *hd) {
int homunculus_change_class(struct homun_data *hd, short class_) {
int i = homun->db_search(class_,HOMUNCULUS_CLASS);
nullpo_retr(0, hd);
- if(i < 0)
+ if (i == INDEX_NOT_FOUND)
return 0;
hd->homunculusDB = &homun->dbs->db[i];
hd->homunculus.class_ = class_;
@@ -769,10 +769,10 @@ int homunculus_db_search(int key,int type) {
return i;
break;
default:
- return -1;
+ return INDEX_NOT_FOUND;
}
}
- return -1;
+ return INDEX_NOT_FOUND;
}
/**
@@ -797,7 +797,7 @@ bool homunculus_create(struct map_session_data *sd, const struct s_homunculus *h
Assert_retr(false, sd->status.hom_id == 0 || sd->hd == 0 || sd->hd->master == sd);
i = homun->db_search(hom->class_,HOMUNCULUS_CLASS);
- if(i < 0) {
+ if (i == INDEX_NOT_FOUND) {
ShowError("homunculus_create: unknown class [%d] for homunculus '%s', requesting deletion.\n", hom->class_, hom->name);
sd->status.hom_id = 0;
intif->homunculus_requestdelete(hom->hom_id);
@@ -948,7 +948,8 @@ bool homunculus_creation_request(struct map_session_data *sd, int class_) {
nullpo_retr(false, sd);
i = homun->db_search(class_,HOMUNCULUS_CLASS);
- if(i < 0) return false;
+ if (i == INDEX_NOT_FOUND)
+ return false;
memset(&hom, 0, sizeof(struct s_homunculus));
//Initial data