Fixed bugreport:6324 mobs now clear attacked data on death. special thanks to vali.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16527 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind 2012-07-29 01:59:38 +00:00
parent b08737ab8c
commit a82b86699f
2 changed files with 12 additions and 17 deletions

View File

@ -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_);
}

View File

@ -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 );
}