mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-11 03:30:33 +00:00
Merge branch 'master' into Playerbot
# Conflicts: # src/server/game/Entities/Unit/Unit.cpp
This commit is contained in:
@@ -20713,3 +20713,58 @@ bool Unit::SetCannotReachTarget(bool cannotReach, bool /*isChase = true*/)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Unit::IsInDisallowedMountForm() const
|
||||
{
|
||||
if (SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(getTransForm()))
|
||||
{
|
||||
if (transformSpellInfo->HasAttribute(SPELL_ATTR0_ALLOW_WHILE_MOUNTED))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ShapeshiftForm form = GetShapeshiftForm())
|
||||
{
|
||||
SpellShapeshiftEntry const* shapeshift = sSpellShapeshiftStore.LookupEntry(form);
|
||||
if (!shapeshift)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(shapeshift->flags1 & 0x1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetDisplayId() == GetNativeDisplayId())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureDisplayInfoEntry const* display = sCreatureDisplayInfoStore.LookupEntry(GetDisplayId());
|
||||
if (!display)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtendedDisplayInfoID);
|
||||
if (!displayExtra)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId);
|
||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->DisplayRaceID);
|
||||
|
||||
if (model && !(model->HasFlag(CREATURE_MODEL_DATA_FLAGS_CAN_MOUNT)))
|
||||
{
|
||||
if (race && !(race->HasFlag(CHRRACES_FLAGS_CAN_MOUNT)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user