mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
fix(Core/Object): Add infinite gob check (#9667)
* cherry-pick commit (b0db728c49)
Co-authored-by: Kittnz <5845231+kittnz@users.noreply.github.com>
This commit is contained in:
@@ -400,6 +400,12 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
||||
SetVisibilityDistanceOverride(VisibilityDistanceType::Large);
|
||||
}
|
||||
|
||||
// Check if GameObject is Infinite
|
||||
if (goinfo->IsInfiniteGameObject())
|
||||
{
|
||||
SetVisibilityDistanceOverride(VisibilityDistanceType::Infinite);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -624,6 +624,25 @@ struct GameObjectTemplate
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsInfiniteGameObject() const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GAMEOBJECT_TYPE_DOOR:
|
||||
return true;
|
||||
case GAMEOBJECT_TYPE_FLAGSTAND:
|
||||
return true;
|
||||
case GAMEOBJECT_TYPE_FLAGDROP:
|
||||
return true;
|
||||
case GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY:
|
||||
return true;
|
||||
case GAMEOBJECT_TYPE_TRAPDOOR:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsGameObjectForQuests() const
|
||||
{
|
||||
return IsForQuests;
|
||||
|
||||
Reference in New Issue
Block a user