From ad958235cfc56b86da89bdc2aa1e5155b0c006a1 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 23 Jan 2014 19:35:01 +0100 Subject: 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 --- src/map/npc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/map/npc.c') 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) { -- cgit v1.2.3-60-g2f50