Skip to content

Commit

Permalink
Visibility: Make buildings and trapdoor gos infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Mar 9, 2025
1 parent 071518a commit fe66ee6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/game/Entities/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ bool GameObject::Create(uint32 dbGuid, uint32 guidlow, uint32 name_id, Map* map,
if (GetGOInfo()->IsLargeGameObject() && GetVisibilityData().GetVisibilityDistance() < VISIBILITY_DISTANCE_LARGE)
GetVisibilityData().SetVisibilityDistanceOverride(VisibilityDistanceType::Large);

if (GetGOInfo()->IsInfiniteGameObject())
GetVisibilityData().SetVisibilityDistanceOverride(VisibilityDistanceType::Infinite);

return true;
}

Expand Down
15 changes: 15 additions & 0 deletions src/game/Entities/GameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,21 @@ struct GameObjectInfo
}
}

bool IsInfiniteGameObject() const
{
switch (type)
{
case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING: return true;
case GAMEOBJECT_TYPE_TRAPDOOR: return true;
default: return false;
}
}

bool IsLargeOrBiggerGameObject() const
{
return IsLargeGameObject() || IsInfiniteGameObject();
}

bool IsServerOnly() const
{
switch (type)
Expand Down
4 changes: 2 additions & 2 deletions src/game/Globals/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ void ObjectMgr::LoadSpawnGroups()
entry.Active = true;
break;
}
else if (specials && goInfo->IsLargeGameObject())
else if (specials && goInfo->IsLargeOrBiggerGameObject())
{
entry.Large = true;
break;
Expand Down Expand Up @@ -2674,7 +2674,7 @@ void ObjectMgr::LoadGameObjects()

if (sWorld.getConfig(CONFIG_BOOL_AUTOLOAD_ACTIVE) && gInfo && gInfo->ExtraFlags & GAMEOBJECT_EXTRA_FLAG_ACTIVE)
m_activeGameObjects.emplace(data.mapid, guid);
else if (sWorld.getConfig(CONFIG_BOOL_SPECIALS_ACTIVE) && gInfo && gInfo->IsLargeGameObject())
else if (sWorld.getConfig(CONFIG_BOOL_SPECIALS_ACTIVE) && gInfo && gInfo->IsLargeOrBiggerGameObject())
m_largeGameObjects.emplace(data.mapid, guid);
}

Expand Down

0 comments on commit fe66ee6

Please sign in to comment.