diff options
Diffstat (limited to 'src/server/collision')
| -rw-r--r-- | src/server/collision/BoundingIntervalHierarchy.cpp | 2 | ||||
| -rw-r--r-- | src/server/collision/Management/VMapFactory.cpp | 92 | ||||
| -rw-r--r-- | src/server/collision/Management/VMapFactory.h | 3 |
3 files changed, 2 insertions, 95 deletions
diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp index 76218936879..ad3753ea3c9 100644 --- a/src/server/collision/BoundingIntervalHierarchy.cpp +++ b/src/server/collision/BoundingIntervalHierarchy.cpp @@ -241,7 +241,7 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat bool BIH::writeToFile(FILE* wf) const { uint32 treeSize = tree.size(); - uint32 check=0, count=0; + uint32 check=0, count; check += fwrite(&bounds.low(), sizeof(float), 3, wf); check += fwrite(&bounds.high(), sizeof(float), 3, wf); check += fwrite(&treeSize, sizeof(uint32), 1, wf); diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp index 428ef320f5d..4d3719cf288 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 05fdc193c74..1545a8f6977 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); }; } |
