aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-28 11:26:20 -0500
committermegamage <none@none>2009-08-28 11:26:20 -0500
commitab5f515f21d1f9e735e8b2c91a64f2dd02512ed5 (patch)
treebc50ecf26bc74e872d11d21e6e17c86618462e64 /src/game/Unit.cpp
parent9d28323a55aaca70135c598baaaa340a16cf4540 (diff)
*Update flame levi script. Allow player to shoot down pyrite container and refill the demolishers.
*Other script-related fixes. --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 4b18db2c0a1..d6170c323d9 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11149,7 +11149,6 @@ void Unit::setDeathState(DeathState s)
if (m_deathState != ALIVE && s == ALIVE)
{
//_ApplyAllAuraMods();
- if(m_vehicleKit) m_vehicleKit->Reset();
// Reset display id on resurection - needed by corpse explosion to cleanup after display change
SetDisplayId(GetNativeDisplayId());
}
@@ -12164,8 +12163,6 @@ void Unit::AddToWorld()
assert(m_NotifyListPos < 0); //instance : crash
//m_NotifyListPos = -1;
SetToNotify();
- if(IsVehicle())
- GetVehicleKit()->Install();
}
}
@@ -14642,7 +14639,17 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
{
- if(GetTypeId() == TYPEID_UNIT)
+ Player *player = NULL;
+ if(GetTypeId() == TYPEID_PLAYER)
+ player = (Player*)this;
+ else
+ {
+ player = dynamic_cast<Player*>(GetCharmer());
+ if(player && player->m_mover != this)
+ player = NULL;
+ }
+
+ if(!player)
{
GetMotionMaster()->MoveKnockbackFrom(x, y, speedXY, speedZ);
}
@@ -14659,7 +14666,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
data << float(speedXY); // Horizontal speed
data << float(-speedZ); // Z Movement speed (vertical)
- ((Player*)this)->GetSession()->SendPacket(&data);
+ player->GetSession()->SendPacket(&data);
}
}