diff options
| author | megamage <none@none> | 2008-11-23 13:58:06 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-11-23 13:58:06 -0600 |
| commit | 8d687761bcea04c9d9d4add8699df5e48ec0d546 (patch) | |
| tree | a596417166e5e4d8f3b41ac1a233db0b1ace87d9 /src/game/Unit.cpp | |
| parent | fb64da2182ddb732c44ab102c670fe3abf23188d (diff) | |
*Creatures with the same faction should always be friendly to each other. This fix the bug that creatures with the same faction fight earch other.
*Allow "chain effect" when creatures call assistance.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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); |
