From ab5f515f21d1f9e735e8b2c91a64f2dd02512ed5 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 28 Aug 2009 11:26:20 -0500 Subject: *Update flame levi script. Allow player to shoot down pyrite container and refill the demolishers. *Other script-related fixes. --HG-- branch : trunk --- src/game/Unit.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/game/Unit.cpp') 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(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); } } -- cgit v1.2.3