diff options
| author | joschiwald <joschiwald@online.de> | 2012-12-30 18:52:32 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald@online.de> | 2012-12-30 18:52:32 +0100 |
| commit | 22896bd7a46ade453e72ad09138b3c6d62efe4e7 (patch) | |
| tree | 5bd55eeb31cba48826a98d549a465799e625c391 /src/server/collision | |
| parent | 0aef9419b6939a92a6c64fb873bf3f7a4820088b (diff) | |
Core/VMaps: drop "vmap.ignoreSpellIds" in config, this is not longer necessary since we use SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS
Diffstat (limited to 'src/server/collision')
| -rw-r--r-- | src/server/collision/Management/VMapFactory.cpp | 92 | ||||
| -rw-r--r-- | src/server/collision/Management/VMapFactory.h | 3 |
2 files changed, 1 insertions, 94 deletions
diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp index 657f989a0c0..ed351e4f7ad 100644 --- a/src/server/collision/Management/VMapFactory.cpp +++ b/src/server/collision/Management/VMapFactory.cpp @@ -16,99 +16,12 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> #include "VMapFactory.h" #include "VMapManager2.h" -#include "G3D/Table.h" - -using namespace G3D; namespace VMAP { - void chompAndTrim(std::string& str) - { - while (str.length() >0) - { - char lc = str[str.length()-1]; - if (lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'') - { - str = str.substr(0, str.length()-1); - } - else - { - break; - } - } - while (str.length() >0) - { - char lc = str[0]; - if (lc == ' ' || lc == '"' || lc == '\'') - { - str = str.substr(1, str.length()-1); - } - else - { - break; - } - } - } - - IVMapManager* gVMapManager = 0; - Table<unsigned int, bool>* iIgnoreSpellIds=0; - - //=============================================== - // result false, if no more id are found - - bool getNextId(const std::string& pString, unsigned int& pStartPos, unsigned int& pId) - { - bool result = false; - unsigned int i; - for (i=pStartPos;i<pString.size(); ++i) - { - if (pString[i] == ',') - { - break; - } - } - if (i>pStartPos) - { - std::string idString = pString.substr(pStartPos, i-pStartPos); - pStartPos = i+1; - chompAndTrim(idString); - pId = atoi(idString.c_str()); - result = true; - } - return(result); - } - - //=============================================== - /** - parameter: String of map ids. Delimiter = "," - */ - - void VMapFactory::preventSpellsFromBeingTestedForLoS(const char* pSpellIdString) - { - if (!iIgnoreSpellIds) - iIgnoreSpellIds = new Table<unsigned int, bool>(); - if (pSpellIdString != NULL) - { - unsigned int pos =0; - unsigned int id; - std::string confString(pSpellIdString); - chompAndTrim(confString); - while (getNextId(confString, pos, id)) - { - iIgnoreSpellIds->set(id, true); - } - } - } - - //=============================================== - - bool VMapFactory::checkSpellForLoS(unsigned int pSpellId) - { - return(!iIgnoreSpellIds->containsKey(pSpellId)); - } + IVMapManager* gVMapManager = NULL; //=============================================== // just return the instance @@ -123,9 +36,6 @@ namespace VMAP // delete all internal data structures void VMapFactory::clear() { - delete iIgnoreSpellIds; - iIgnoreSpellIds = NULL; - delete gVMapManager; gVMapManager = NULL; } diff --git a/src/server/collision/Management/VMapFactory.h b/src/server/collision/Management/VMapFactory.h index 27bce523c43..2a6785cc5d0 100644 --- a/src/server/collision/Management/VMapFactory.h +++ b/src/server/collision/Management/VMapFactory.h @@ -34,9 +34,6 @@ namespace VMAP public: static IVMapManager* createOrGetVMapManager(); static void clear(); - - static void preventSpellsFromBeingTestedForLoS(const char* pSpellIdString); - static bool checkSpellForLoS(unsigned int pSpellId); }; } |
