diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp index 637410c1f..25244e7a2 100644 --- a/src/game/AggressorAI.cpp +++ b/src/game/AggressorAI.cpp @@ -47,15 +47,23 @@ AggressorAI::MoveInLineOfSight(Unit *u) if( !i_creature.canFly() && i_creature.GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE ) return; - if( !i_creature.getVictim() && !i_creature.hasUnitState(UNIT_STAT_STUNNED) && u->isTargetableForAttack() && + if( !i_creature.hasUnitState(UNIT_STAT_STUNNED) && u->isTargetableForAttack() && ( i_creature.IsHostileTo( u ) /*|| u->getVictim() && i_creature.IsFriendlyTo( u->getVictim() )*/ ) && u->isInAccessablePlaceFor(&i_creature) ) { float attackRadius = i_creature.GetAttackDistance(u); if(i_creature.IsWithinDistInMap(u, attackRadius) && i_creature.IsWithinLOSInMap(u) ) { - AttackStart(u); - u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + if(!i_creature.getVictim()) + { + AttackStart(u); + u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + } + else if(sMapStore.LookupEntry(i_creature.GetMapId())->IsDungeon()) + { + u->SetInCombatWith(&i_creature); + i_creature.AddThreat(u, 0.0f); + } } } } diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 05eb46197..602d3d247 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -70,7 +70,7 @@ inline void PlayerCreatureRelocationWorker(Player* pl, Creature* c) pl->UpdateVisibilityOf(c); // Creature AI reaction - if(!c->hasUnitState(UNIT_STAT_CHASE | UNIT_STAT_SEARCHING | UNIT_STAT_FLEEING)) + if(!c->hasUnitState(UNIT_STAT_SEARCHING | UNIT_STAT_FLEEING)) { if( c->AI() && c->AI()->IsVisible(pl) && !c->IsInEvadeMode() ) c->AI()->MoveInLineOfSight(pl); @@ -79,13 +79,13 @@ inline void PlayerCreatureRelocationWorker(Player* pl, Creature* c) inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2) { - if(!c1->hasUnitState(UNIT_STAT_CHASE | UNIT_STAT_SEARCHING | UNIT_STAT_FLEEING)) + if(!c1->hasUnitState(UNIT_STAT_SEARCHING | UNIT_STAT_FLEEING)) { if( c1->AI() && c1->AI()->IsVisible(c2) && !c1->IsInEvadeMode() ) c1->AI()->MoveInLineOfSight(c2); } - if(!c2->hasUnitState(UNIT_STAT_CHASE | UNIT_STAT_SEARCHING | UNIT_STAT_FLEEING)) + if(!c2->hasUnitState(UNIT_STAT_SEARCHING | UNIT_STAT_FLEEING)) { if( c2->AI() && c2->AI()->IsVisible(c1) && !c2->IsInEvadeMode() ) c2->AI()->MoveInLineOfSight(c1); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 430e9c2b3..6a19ed4cf 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "6884" + #define REVISION_NR "6885" #endif // __REVISION_NR_H__