diff options
author | runningnak3d <none@none> | 2010-10-08 20:14:12 -0600 |
---|---|---|
committer | runningnak3d <none@none> | 2010-10-08 20:14:12 -0600 |
commit | 3feda9b6af99e2d8161bf8ff5a55554d290342a5 (patch) | |
tree | 048c77faf18e6e3902df5df67d7a563742f0743a | |
parent | a6170675c60c53d3cbc2d17d3dbd74d3e813d5b9 (diff) |
Core/Vmaps: Remove the ability to ignore individual maps from vmap LOS /
height checking. Also add a warning if vmap.enableHeight is disabled. You
*MUST* have all LOS / height checking enabled to have a functional server.
Original patch by: Vladimir
--HG--
branch : trunk
-rwxr-xr-x | src/server/collision/Management/IVMapManager.h | 6 | ||||
-rw-r--r-- | src/server/collision/Management/VMapManager2.cpp | 33 | ||||
-rwxr-xr-x | src/server/collision/Management/VMapManager2.h | 3 | ||||
-rwxr-xr-x | src/server/game/World/World.cpp | 11 | ||||
-rw-r--r-- | src/server/worldserver/worldserver.conf.dist | 8 |
5 files changed, 8 insertions, 53 deletions
diff --git a/src/server/collision/Management/IVMapManager.h b/src/server/collision/Management/IVMapManager.h index 84aa9b5f430..d4c75fd0cfc 100755 --- a/src/server/collision/Management/IVMapManager.h +++ b/src/server/collision/Management/IVMapManager.h @@ -89,12 +89,6 @@ namespace VMAP virtual std::string getDirFileName(unsigned int pMapId, int x, int y) const =0; /** - Block maps from being used. - parameter: String of map ids. Delimiter = "," - e.g.: "0,1,530" - */ - virtual void preventMapsFromBeingUsed(const char* pMapIdString) =0; - /** Query world model area info. \param z gets adjusted to the ground height for which this are info is valid */ diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 4f009fabeb1..c2cebaa1292 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -89,42 +89,11 @@ namespace VMAP } //========================================================= - /** - Block maps from being used. - parameter: String of map ids. Delimiter = "," - e.g.: "0,1,590" - */ - - void VMapManager2::preventMapsFromBeingUsed(const char* pMapIdString) - { - iIgnoreMapIds.clear(); - if (pMapIdString != NULL) - { - std::string map_str; - std::stringstream map_ss; - map_ss.str(std::string(pMapIdString)); - while (std::getline(map_ss, map_str, ',')) - { - std::stringstream ss2(map_str); - int map_num = -1; - ss2 >> map_num; - if (map_num >= 0) - { - sLog.outDebug("Ignoring Map %i for VMaps", map_num); - iIgnoreMapIds[map_num] = true; - // unload map in case it is loaded - unloadMap(map_num); - } - } - } - } - - //========================================================= int VMapManager2::loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) { int result = VMAP_LOAD_RESULT_IGNORED; - if (isMapLoadingEnabled() && !iIgnoreMapIds.count(pMapId)) + if (isMapLoadingEnabled()) { if (_loadMap(pMapId, pBasePath, x, y)) result = VMAP_LOAD_RESULT_OK; diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index 7b1510474ce..34cb77f866e 100755 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -67,8 +67,6 @@ namespace VMAP // Tree to check collision ModelFileMap iLoadedModelFiles; InstanceTreeMap iInstanceMapTrees; - // UNORDERED_MAP<unsigned int , bool> iMapsSplitIntoTiles; - UNORDERED_MAP<unsigned int , bool> iIgnoreMapIds; bool _loadMap(uint32 pMapId, const std::string &basePath, uint32 tileX, uint32 tileY); /* void _unloadMap(uint32 pMapId, uint32 x, uint32 y); */ @@ -96,7 +94,6 @@ namespace VMAP bool processCommand(char * /*pCommand*/) { return false; } // for debug and extensions - void preventMapsFromBeingUsed(const char* pMapIdString); bool getAreaInfo(unsigned int pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const; bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 ReqLiquidType, float &level, float &floor, uint32 &type) const; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 703bc4e2488..62e545262a6 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1149,17 +1149,20 @@ void World::LoadConfigSettings(bool reload) } m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfig.GetBoolDefault("vmap.enableIndoorCheck", 0); + bool enableIndoor = sConfig.GetBoolDefault("vmap.enableIndoorCheck", true); bool enableLOS = sConfig.GetBoolDefault("vmap.enableLOS", true); bool enableHeight = sConfig.GetBoolDefault("vmap.enableHeight", true); - std::string ignoreMapIds = sConfig.GetStringDefault("vmap.ignoreMapIds", ""); + bool enablePetLOS = sConfig.GetBoolDefault("vmap.petLOS", true); std::string ignoreSpellIds = sConfig.GetStringDefault("vmap.ignoreSpellIds", ""); + + if (!enableHeight) + sLog.outError("VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support."); + VMAP::VMapFactory::createOrGetVMapManager()->setEnableLineOfSightCalc(enableLOS); VMAP::VMapFactory::createOrGetVMapManager()->setEnableHeightCalc(enableHeight); - VMAP::VMapFactory::createOrGetVMapManager()->preventMapsFromBeingUsed(ignoreMapIds.c_str()); VMAP::VMapFactory::preventSpellsFromBeingTestedForLoS(ignoreSpellIds.c_str()); - sLog.outString("WORLD: VMap support included. LineOfSight:%i, getHeight:%i",enableLOS, enableHeight); + sLog.outString("WORLD: VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS); sLog.outString("WORLD: VMap data directory is: %svmaps",m_dataPath.c_str()); - sLog.outString("WORLD: VMap config keys are: vmap.enableLOS, vmap.enableHeight, vmap.ignoreMapIds, vmap.ignoreSpellIds"); m_int_configs[CONFIG_MAX_WHO] = sConfig.GetIntDefault("MaxWhoListReturns", 49); m_bool_configs[CONFIG_PET_LOS] = sConfig.GetBoolDefault("vmap.petLOS", true); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index dc368b598da..642b0a6b806 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -184,13 +184,6 @@ EAIErrorLevel = 2 # 0 (disable) # Default: 1 (enable) # -# vmap.ignoreMapIds -# Map id that will be ignored by VMaps -# List of ids with delimiter ',' -# If more then one id is defined and spaces are included, the string -# has to be enclosed by " -# Example: "369,0,1,530" -# # vmap.ignoreSpellIds # These spells are ignored for LoS calculation # List of ids with delimiter ',' @@ -275,7 +268,6 @@ PlayerSave.Stats.MinLevel = 0 PlayerSave.Stats.SaveOnlyOnLogout = 1 vmap.enableLOS = 1 vmap.enableHeight = 1 -vmap.ignoreMapIds = "" vmap.ignoreSpellIds = "7720" vmap.petLOS = 1 vmap.enableIndoorCheck = 1 |