feat(Map): Add open world LOS settings (#18816)

* chore. Add open world LOS settings

* Name change and conditional deny

* modify information in worldserver.conf.dist

* Remove pvp from variables and constants
This commit is contained in:
Walter Pagani
2024-05-04 12:10:24 -03:00
committed by GitHub
parent 1621d6b477
commit 715b290cb7
5 changed files with 20 additions and 0 deletions

View File

@@ -1342,6 +1342,15 @@ vmap.petLOS = 1
vmap.BlizzlikePvPLOS = 1
#
# vmap.BlizzlikeLOSInOpenWorld
# Description: Check line of sight to see game objects in the open world.
# Default: 1 (Enabled, Players will be able to cast spells through tree stumps and other objects in the open world).
# 0 (Disabled, Players will not be able to cast spells through tree stumps and other objects in the open world).
#
vmap.BlizzlikeLOSInOpenWorld = 1
#
# vmap.enableIndoorCheck
# Description: VMap based indoor check to remove outdoor-only auras (mounts etc.).

View File

@@ -2445,6 +2445,14 @@ bool Map::isInLineOfSight(float x1, float y1, float z1, float x2, float y2, floa
}
}
if (!sWorld->getBoolConfig(CONFIG_VMAP_BLIZZLIKE_LOS_OPEN_WORLD))
{
if (IsWorldMap())
{
ignoreFlags = VMAP::ModelIgnoreFlags::Nothing;
}
}
if ((checks & LINEOFSIGHT_CHECK_VMAP) && !VMAP::VMapFactory::createOrGetVMapMgr()->isInLineOfSight(GetId(), x1, y1, z1, x2, y2, z2, ignoreFlags))
{
return false;

View File

@@ -454,6 +454,7 @@ public:
[[nodiscard]] bool IsBattleground() const { return i_mapEntry && i_mapEntry->IsBattleground(); }
[[nodiscard]] bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
[[nodiscard]] bool IsBattlegroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattlegroundOrArena(); }
[[nodiscard]] bool IsWorldMap() const { return i_mapEntry && i_mapEntry->IsWorldMap(); }
bool GetEntrancePos(int32& mapid, float& x, float& y)
{

View File

@@ -178,6 +178,7 @@ enum WorldBoolConfigs
CONFIG_LEAVE_GROUP_ON_LOGOUT,
CONFIG_QUEST_POI_ENABLED,
CONFIG_VMAP_BLIZZLIKE_PVP_LOS,
CONFIG_VMAP_BLIZZLIKE_LOS_OPEN_WORLD,
CONFIG_OBJECT_SPARKLES,
CONFIG_LOW_LEVEL_REGEN_BOOST,
CONFIG_OBJECT_QUEST_MARKERS,

View File

@@ -1317,6 +1317,7 @@ void World::LoadConfigSettings(bool reload)
bool enableHeight = sConfigMgr->GetOption<bool>("vmap.enableHeight", true);
bool enablePetLOS = sConfigMgr->GetOption<bool>("vmap.petLOS", true);
_bool_configs[CONFIG_VMAP_BLIZZLIKE_PVP_LOS] = sConfigMgr->GetOption<bool>("vmap.BlizzlikePvPLOS", true);
_bool_configs[CONFIG_VMAP_BLIZZLIKE_LOS_OPEN_WORLD] = sConfigMgr->GetOption<bool>("vmap.BlizzlikeLOSInOpenWorld", true);
if (!enableHeight)
LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");