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 /src/map/mob.c | |
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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 23 |
1 files changed, 10 insertions, 13 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_); } |