From 797f0ba30ddc348e90138172c0f056acb30bc674 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 9 Oct 2010 02:39:59 +0400 Subject: [PATCH] [10596] Apply restrictions to vmap options. After switch to new vmap version and later height check code chnages some vmap related options now outdated. * Option vmap.ignoreMapIds removed. You can't now diable vmaps use for selected maps. * Option vmap.enableHeight must be always enabled for normal work server and server at startup now pring error if it's diabled. Option still supported just for special work cases (debug, new clients testing, etc). Possible soon option vmap.ignoreSpellIds also will be removed, because like los ignore checks must be in spell code instead options. --- src/game/World.cpp | 10 ++++++---- src/mangosd/mangosd.conf.dist.in | 6 ------ src/shared/revision_nr.h | 2 +- src/shared/vmap/IVMapManager.h | 6 ------ src/shared/vmap/VMapManager2.cpp | 33 +------------------------------- src/shared/vmap/VMapManager2.h | 3 --- 6 files changed, 8 insertions(+), 52 deletions(-) diff --git a/src/game/World.cpp b/src/game/World.cpp index 62c77a21014..cb92a8d6b6c 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -857,15 +857,17 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK, "vmap.enableIndoorCheck", true); bool enableLOS = sConfig.GetBoolDefault("vmap.enableLOS", false); bool enableHeight = sConfig.GetBoolDefault("vmap.enableHeight", false); - std::string ignoreMapIds = sConfig.GetStringDefault("vmap.ignoreMapIds", ""); std::string ignoreSpellIds = sConfig.GetStringDefault("vmap.ignoreSpellIds", ""); + + if (!enableHeight) + sLog.outError("VMAP height use disabled! Creatures movements and other things will be in broken state."); + 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", + enableLOS, enableHeight, getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) ? 1 : 0); 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"); } /// Initialize the World diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index d2f1eeb5265..91cb4936b2b 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -137,12 +137,6 @@ BindIP = "0.0.0.0" # Default: 0 (disable) # 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 ',' diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a50daf73a5b..9521604c139 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10595" + #define REVISION_NR "10596" #endif // __REVISION_NR_H__ diff --git a/src/shared/vmap/IVMapManager.h b/src/shared/vmap/IVMapManager.h index 4ca38154b55..54708569f19 100644 --- a/src/shared/vmap/IVMapManager.h +++ b/src/shared/vmap/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/shared/vmap/VMapManager2.cpp b/src/shared/vmap/VMapManager2.cpp index 829c1d98d2a..3b68b89eb01 100644 --- a/src/shared/vmap/VMapManager2.cpp +++ b/src/shared/vmap/VMapManager2.cpp @@ -87,43 +87,12 @@ namespace VMAP return fname.str(); } - //========================================================= - /** - 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) - { - DETAIL_LOG("Ignoring Map %i for VMaps", map_num); - iIgnoreMapIds[map_num] = true; - // unload map in case it is loaded - unloadMap(map_num); - } - } - } - } - //========================================================= VMAPLoadResult VMapManager2::loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) { VMAPLoadResult 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/shared/vmap/VMapManager2.h b/src/shared/vmap/VMapManager2.h index a6f92431e71..b9204ab1c1b 100644 --- a/src/shared/vmap/VMapManager2.h +++ b/src/shared/vmap/VMapManager2.h @@ -67,8 +67,6 @@ namespace VMAP // Tree to check collision ModelFileMap iLoadedModelFiles; InstanceTreeMap iInstanceMapTrees; - // UNORDERED_MAP iMapsSplitIntoTiles; - UNORDERED_MAP 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;