aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-27 12:42:38 -0500
committermegamage <none@none>2009-05-27 12:42:38 -0500
commitffca6ec384419fab9b9217fc39e922f47c5d65ba (patch)
tree2c60a1ee02be20e85ccb08aa362d0bc8a3fd6736 /src/game/Unit.cpp
parent75942caacb0f098b26e77260a8821fe853091122 (diff)
*Change vehicle faction the same as the driver's when driver enters it.
*Fix 3593 sql. --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e2db82879a4..ad210ad8fd6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -13626,16 +13626,16 @@ void Unit::RestoreFaction()
((Player*)this)->setFactionForRace(getRace());
else
{
- CreatureInfo const *cinfo = ((Creature*)this)->GetCreatureInfo();
-
- if(((Creature*)this)->isPet())
+ if(((Creature*)this)->HasSummonMask(SUMMON_MASK_MINION))
{
if(Unit* owner = GetOwner())
+ {
setFaction(owner->getFaction());
- else if(cinfo)
- setFaction(cinfo->faction_A);
+ return;
+ }
}
- else if(cinfo) // normal creature
+
+ if(CreatureInfo const *cinfo = ((Creature*)this)->GetCreatureInfo()) // normal creature
setFaction(cinfo->faction_A);
}
}