aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Creature.cpp3
-rw-r--r--src/game/GridNotifiers.h3
-rw-r--r--src/game/Unit.cpp12
-rw-r--r--src/shared/Database/DBCStructure.h4
4 files changed, 18 insertions, 4 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index c547065b206..79c1bf18008 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1891,7 +1891,8 @@ void Creature::CallAssistence()
for(std::list<Creature*>::iterator iter = assistList.begin(); iter != assistList.end(); ++iter)
{
- (*iter)->SetNoCallAssistence(true);
+ //(*iter)->SetNoCallAssistence(true);
+ (*iter)->CombatStart(getVictim());
if((*iter)->AI())
(*iter)->AI()->AttackStart(getVictim());
}
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index 3561f30861c..6b4dd39306c 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -783,6 +783,9 @@ namespace Trinity
if(u->getFaction() != i_funit->getFaction() )
return false;
+ if(!u->isAggressive())
+ return false;
+
// only free creature
if( u->GetCharmerOrOwnerGUID() )
return false;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 83ad2b51b1c..642b49ee99a 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -8486,10 +8486,16 @@ void Unit::CombatStart(Unit* target)
if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
&& ((Creature*)target)->isAggressive() && ((Creature*)target)->AI())
+ {
+ SetInCombatWith(target);
+ target->SetInCombatWith(this);
((Creature*)target)->AI()->AttackStart(this);
-
- SetInCombatWith(target);
- target->SetInCombatWith(this);
+ }
+ else
+ {
+ SetInCombatWith(target);
+ target->SetInCombatWith(this);
+ }
if(Player* attackedPlayer = target->GetCharmerOrOwnerPlayerOrPlayerItself())
SetContestedPvP(attackedPlayer);
diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h
index a71f80ac8c7..ce72661066b 100644
--- a/src/shared/Database/DBCStructure.h
+++ b/src/shared/Database/DBCStructure.h
@@ -229,6 +229,8 @@ struct FactionTemplateEntry
// helpers
bool IsFriendlyTo(FactionTemplateEntry const& entry) const
{
+ if(ID == entry.ID)
+ return true;
if(enemyFaction1 == entry.faction || enemyFaction2 == entry.faction || enemyFaction3 == entry.faction || enemyFaction4 == entry.faction )
return false;
if(friendFaction1 == entry.faction || friendFaction2 == entry.faction || friendFaction3 == entry.faction || friendFaction4 == entry.faction )
@@ -237,6 +239,8 @@ struct FactionTemplateEntry
}
bool IsHostileTo(FactionTemplateEntry const& entry) const
{
+ if(ID == entry.ID)
+ return false;
if(enemyFaction1 == entry.faction || enemyFaction2 == entry.faction || enemyFaction3 == entry.faction || enemyFaction4 == entry.faction )
return true;
if(friendFaction1 == entry.faction || friendFaction2 == entry.faction || friendFaction3 == entry.faction || friendFaction4 == entry.faction )