Core/Movement: merged Collision height handling from 335 branch to reduce the probability that creatures are falling under the map
This commit is contained in:
1 parent
3357ae7940
commit
50a91bd590
16 files changed
+134
-138
No files matched your search
@@ -8204,7 +8204,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry)
|
||||
if (charm->GetTypeId() == TYPEID_UNIT)
|
||||
charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
player->SendMovementSetCollisionHeight(player->GetCollisionHeight(true));
|
||||
player->SendMovementSetCollisionHeight(player->GetCollisionHeight());
|
||||
}
|
||||
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOUNT);
|
||||
@@ -8221,7 +8221,7 @@ void Unit::Dismount()
|
||||
if (Player* thisPlayer = ToPlayer())
|
||||
{
|
||||
SendUpdateToSet();
|
||||
thisPlayer->SendMovementSetCollisionHeight(thisPlayer->GetCollisionHeight(false));
|
||||
thisPlayer->SendMovementSetCollisionHeight(thisPlayer->GetCollisionHeight());
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_DISMOUNT, 8);
|
||||
@@ -14806,6 +14806,30 @@ void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/
|
||||
target->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
float Unit::GetCollisionHeight() const
|
||||
{
|
||||
float scaleMod = GetObjectScale(); // 99% sure about this
|
||||
|
||||
if (IsMounted())
|
||||
{
|
||||
if (CreatureDisplayInfoEntry const* mountDisplayInfo = sCreatureDisplayInfoStore.LookupEntry(GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID)))
|
||||
{
|
||||
if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId))
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId());
|
||||
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId);
|
||||
return scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! Dismounting case - use basic default model data
|
||||
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId());
|
||||
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId);
|
||||
|
||||
return scaleMod * modelData->CollisionHeight;
|
||||
}
|
||||
|
||||
SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo) const
|
||||
{
|
||||
Unit::AuraEffectList swaps = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS);
|
||||
|
||||
Reference in new issue
Block a user