diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-29 01:59:38 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-29 01:59:38 +0000 |
commit | 60c0cfd6bcc66be6ea3648b0e2810cfb60f75aed (patch) | |
tree | 5cfe4cd08897c00ea8cc10cd0a3be1bf452dbcfa | |
parent | bfc097da65478acd0fff4414621f705bcc2cd739 (diff) | |
download | hercules-60c0cfd6bcc66be6ea3648b0e2810cfb60f75aed.tar.gz hercules-60c0cfd6bcc66be6ea3648b0e2810cfb60f75aed.tar.bz2 hercules-60c0cfd6bcc66be6ea3648b0e2810cfb60f75aed.tar.xz hercules-60c0cfd6bcc66be6ea3648b0e2810cfb60f75aed.zip |
Fixed bugreport:6324 mobs now clear attacked data on death. special thanks to vali.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16527 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/mob.c | 23 | ||||
-rw-r--r-- | src/map/status.c | 6 |
2 files changed, 12 insertions, 17 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 6b0e8ace2..1e9b3caf9 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2055,8 +2055,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage) //Call when a mob has received damage. void mob_damage(struct mob_data *md, struct block_list *src, int damage) { - if (damage > 0) - { //Store total damage... + if (damage > 0) { //Store total damage... if (UINT_MAX - (unsigned int)damage > md->tdmg) md->tdmg+=damage; else if (md->tdmg == UINT_MAX) @@ -2065,8 +2064,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage) damage = (int)(UINT_MAX - md->tdmg); md->tdmg = UINT_MAX; } - if (md->state.aggressive) - { //No longer aggressive, change to retaliate AI. + if (md->state.aggressive) { //No longer aggressive, change to retaliate AI. md->state.aggressive = 0; if(md->state.skillstate== MSS_ANGRY) md->state.skillstate = MSS_BERSERK; @@ -2085,8 +2083,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage) if (!src) return; - if(md->special_state.ai==2/* && md->master_id == src->id*/) - { //LOne WOlf explained that ANYONE can trigger the marine countdown skill. [Skotlex] + if( md->special_state.ai == 2 ) {//LOne WOlf explained that ANYONE can trigger the marine countdown skill. [Skotlex] md->state.alchemist = 1; mobskill_use(md, gettick(), MSC_ALCHEMIST); } @@ -2135,11 +2132,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if(src && src->type == BL_MOB) mob_unlocktarget((struct mob_data *)src,tick); - - if( sd ) - { - if( sd->mission_mobid == md->class_) - { //TK_MISSION [Skotlex] + + /* clear previous target otherwise we'll respawn aiming at the same dude */ + md->attacked_id = 0; + + if( sd ) { + if( sd->mission_mobid == md->class_) { //TK_MISSION [Skotlex] if( ++sd->mission_count >= 100 && (temp = mob_get_random_id(0, 0xE, sd->status.base_level)) ) { pc_addfame(sd, 1); @@ -2152,8 +2150,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) } if( sd->status.party_id ) map_foreachinrange(quest_update_objective_sub,&md->bl,AREA_SIZE,BL_PC,sd->status.party_id,md->class_); - else - if( sd->avail_quests ) + else if( sd->avail_quests ) quest_update_objective(sd, md->class_); } diff --git a/src/map/status.c b/src/map/status.c index fbeb7214f..fb9d8320c 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1204,8 +1204,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s status_change_end(target, SC_SATURDAYNIGHTFEVER, INVALID_TIMER); } - switch (target->type) - { + switch (target->type) { case BL_PC: pc_damage((TBL_PC*)target,src,hp,sp); break; case BL_MOB: mob_damage((TBL_MOB*)target, src, hp); break; case BL_HOM: merc_damage((TBL_HOM*)target,src,hp,sp); break; @@ -1213,8 +1212,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s case BL_ELEM: elemental_damage((TBL_ELEM*)target,src,hp,sp); break; } - if( target->type == BL_PC && ((TBL_PC*)target)->disguise && src ) - {// stop walking when attacked in disguise to prevent walk-delay bug + if( src && target->type == BL_PC && ((TBL_PC*)target)->disguise ) {// stop walking when attacked in disguise to prevent walk-delay bug unit_stop_walking( target, 1 ); } |