From 11c2d016d40070f1895d88c0eb7bb88079555cfd Mon Sep 17 00:00:00 2001 From: xazax-hun Date: Wed, 25 Apr 2012 18:22:00 +0000 Subject: * Code consistency updates. No functional changes. Credits to Lighta. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15974 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/elemental.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/map/elemental.c') diff --git a/src/map/elemental.c b/src/map/elemental.c index fc8c17e0e..a021e8b26 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -247,11 +247,14 @@ int elemental_clean_single_effect(struct elemental_data *ed, int skill_num) { case SC_UPHEAVAL_OPTION: case SC_CIRCLE_OF_FIRE_OPTION: case SC_TIDAL_WEAPON_OPTION: - if( bl ) status_change_end(bl,type,-1); // Master - status_change_end(&ed->bl,type-1,-1); // Elemental Spirit + if( bl ) status_change_end(bl,type,INVALID_TIMER); // Master + status_change_end(&ed->bl,type-1,INVALID_TIMER); // Elemental Spirit break; case SC_ZEPHYR: - if( bl ) status_change_end(bl,type,-1); + if( bl ) status_change_end(bl,type,INVALID_TIMER); + break; + default: + ShowWarning("Invalid SC=%d in elemental_clean_single_effect\n",type); break; } } @@ -346,7 +349,7 @@ int elemental_action(struct elemental_data *ed, struct block_list *bl, unsigned if( elemental_skillnotok(skillnum, ed) ) return 0; - if( ed->ud.skilltimer != -1 ) + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; else if( DIFF_TICK(tick, ed->ud.canact_tick) < 0 ) return 0; @@ -410,7 +413,7 @@ int elemental_change_mode_ack(struct elemental_data *ed, int mode) { if( elemental_skillnotok(skillnum, ed) ) return 0; - if( ed->ud.skilltimer != -1 ) + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; else if( DIFF_TICK(gettick(), ed->ud.canact_tick) < 0 ) return 0; @@ -563,10 +566,10 @@ static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_ ed->last_thinktime = tick; - if( ed->ud.skilltimer != -1 ) + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; - if( ed->ud.walktimer != -1 && ed->ud.walkpath.path_pos <= 2 ) + if( ed->ud.walktimer != INVALID_TIMER && ed->ud.walkpath.path_pos <= 2 ) return 0; //No thinking when you just started to walk. if(ed->ud.walkpath.path_pos < ed->ud.walkpath.path_len && ed->ud.target == sd->bl.id) @@ -582,13 +585,13 @@ static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_ master_dist = distance_bl(&sd->bl, &ed->bl); if( master_dist > AREA_SIZE ) { // Master out of vision range. elemental_unlocktarget(ed); - unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,3); + unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,CLR_TELEPORT); return 0; } else if( master_dist > MAX_ELEDISTANCE ) { // Master too far, chase. short x = sd->bl.x, y = sd->bl.y; if( ed->target_id ) elemental_unlocktarget(ed); - if( ed->ud.walktimer != -1 && ed->ud.target == sd->bl.id ) + if( ed->ud.walktimer != INVALID_TIMER && ed->ud.target == sd->bl.id ) return 0; //Already walking to him if( DIFF_TICK(tick, ed->ud.canmove_tick) < 0 ) return 0; //Can't move yet. @@ -615,7 +618,7 @@ static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_ //Attempt to attack. //At this point we know the target is attackable, we just gotta check if the range matches. - if( ed->ud.target == target->id && ed->ud.attacktimer != -1 ) //Already locked. + if( ed->ud.target == target->id && ed->ud.attacktimer != INVALID_TIMER ) //Already locked. return 1; if( battle_check_range(&ed->bl, target, ed->base_status.rhw.range) ) {//Target within range, engage -- cgit v1.2.3-60-g2f50