summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-01-23 19:35:01 +0100
committerHaru <haru@dotalux.com>2015-06-01 10:11:40 +0200
commitad958235cfc56b86da89bdc2aa1e5155b0c006a1 (patch)
tree8b5d66a4620d28edeeefae1aec67881b98ac0530 /src/map/npc.c
parent42e1df9e61f8efb6340ed1c9238cd247d553d9b8 (diff)
downloadhercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.gz
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.bz2
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.xz
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.zip
Replaced some of the hardcoded values with constants (map)
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index e60a655f0..b901a2de0 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -203,7 +203,7 @@ int npc_enable_sub(struct block_list *bl, va_list ap)
if (sd->npc_id != 0)
return 0;
- pc_stop_walking(sd,1);
+ pc_stop_walking(sd, STOPWALKING_FLAG_FIXPOS);
npc->click(sd,nd);
}
}
@@ -2145,7 +2145,7 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
}
}
- pc->delitem(sd, idx, amount, 0, 6, LOG_TYPE_NPC);
+ pc->delitem(sd, idx, amount, 0, DELITEM_SOLD, LOG_TYPE_NPC);
}
if( z > MAX_ZENY )
@@ -3555,7 +3555,7 @@ const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* st
return strchr(start, '\n');
}
- if (mobspawn.state.ai > 4 && ai != -1) {
+ if (mobspawn.state.ai >= AI_MAX && ai != -1) {
ShowError("npc_parse_mob: Invalid ai %d for mob ID %d in file '%s', line '%d'.\n", mobspawn.state.ai, class_, filepath, strline(buffer, start - buffer));
if (retval) *retval = EXIT_FAILURE;
return strchr(start, '\n');
@@ -3578,7 +3578,7 @@ const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* st
mobspawn.level = mob_lv;
if (size > 0 && size <= 2)
mobspawn.state.size = size;
- if (ai > 0 && ai <= 4)
+ if (ai > AI_NONE && ai < AI_MAX)
mobspawn.state.ai = ai;
if (mobspawn.num > 1 && battle_config.mob_count_rate != 100) {