diff options
| author | Xanadu <none@none> | 2010-07-20 02:49:28 +0200 |
|---|---|---|
| committer | Xanadu <none@none> | 2010-07-20 02:49:28 +0200 |
| commit | 79622802f397258ee0f34327ba3ae6977ca3e7ff (patch) | |
| tree | 1868946c234ab9ee256a6b7766a15713eae94235 /src/server/collision/Management | |
| parent | 7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff) | |
| parent | f906976837502fa5aa81b982b901d1509f5aa0c4 (diff) | |
Merge. Revision history for source files should be all back now.
--HG--
branch : trunk
rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt
rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp
rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h
rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp
rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'src/server/collision/Management')
| -rw-r--r-- | src/server/collision/Management/IVMapManager.h | 4 | ||||
| -rw-r--r-- | src/server/collision/Management/VMapFactory.cpp | 15 | ||||
| -rw-r--r-- | src/server/collision/Management/VMapManager2.cpp | 38 | ||||
| -rw-r--r-- | src/server/collision/Management/VMapManager2.h | 4 |
4 files changed, 29 insertions, 32 deletions
diff --git a/src/server/collision/Management/IVMapManager.h b/src/server/collision/Management/IVMapManager.h index 00629eb122c..6a0e7179fa7 100644 --- a/src/server/collision/Management/IVMapManager.h +++ b/src/server/collision/Management/IVMapManager.h @@ -19,8 +19,8 @@ #ifndef _IVMAPMANAGER_H #define _IVMAPMANAGER_H -#include<string> -#include <Platform/Define.h> +#include <string> +#include "Define.h" //=========================================================== diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp index 331acbace47..561bf0dfa02 100644 --- a/src/server/collision/Management/VMapFactory.cpp +++ b/src/server/collision/Management/VMapFactory.cpp @@ -122,15 +122,10 @@ namespace VMAP // delete all internal data structures void VMapFactory::clear() { - if(iIgnoreSpellIds) - { - delete iIgnoreSpellIds; - iIgnoreSpellIds = NULL; - } - if(gVMapManager) - { - delete gVMapManager; - gVMapManager = NULL; - } + delete iIgnoreSpellIds; + iIgnoreSpellIds = NULL; + + delete gVMapManager; + gVMapManager = NULL; } } diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 1e8a84aee52..61b202c9342 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <iostream> @@ -25,6 +25,7 @@ #include "ModelInstance.h" #include "WorldModel.h" #include "VMapDefinitions.h" +#include "Log.h" using G3D::Vector3; @@ -56,7 +57,7 @@ namespace VMAP Vector3 VMapManager2::convertPositionToInternalRep(float x, float y, float z) const { Vector3 pos; - const float mid = 0.5 * 64.0 * 533.33333333f; + const float mid = 0.5f * 64.0f * 533.33333333f; pos.x = mid - x; pos.y = mid - y; pos.z = z; @@ -69,7 +70,7 @@ namespace VMAP Vector3 VMapManager2::convertPositionToMangosRep(float x, float y, float z) const { Vector3 pos; - const float mid = 0.5 * 64.0 * 533.33333333f; + const float mid = 0.5f * 64.0f * 533.33333333f; pos.x = mid - x; pos.y = mid - y; pos.z = z; @@ -109,7 +110,7 @@ namespace VMAP ss2 >> map_num; if (map_num >= 0) { - std::cout << "ingoring Map " << map_num << " for VMaps\n"; + sLog.outDebug("Ignoring Map %i for VMaps", map_num); iIgnoreMapIds[map_num] = true; // unload map in case it is loaded unloadMap(map_num); @@ -279,6 +280,7 @@ namespace VMAP if (instanceTree->second->GetLocationInfo(pos, info)) { floor = info.ground_Z; + ASSERT(floor < std::numeric_limits<float>::max()); type = info.hitModel->GetLiquidType(); if (ReqLiquidType && !(type & ReqLiquidType)) return false; @@ -299,11 +301,11 @@ namespace VMAP WorldModel *worldmodel = new WorldModel(); if (!worldmodel->readFile(basepath + filename + ".vmo")) { - std::cout << "VMapManager2: could not load '" << basepath << filename << ".vmo'!\n"; + sLog.outError("VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str()); delete worldmodel; return NULL; } - std::cout << "VMapManager2: loading file '" << basepath << filename << "'.\n"; + sLog.outDebug("VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -316,12 +318,12 @@ namespace VMAP ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { - std::cout << "VMapManager2: trying to unload non-loaded file '" << filename << "'!\n"; + sLog.outError("VMapManager2: trying to unload non-loaded file '%s'", filename.c_str()); return; } if( model->second.decRefCount() == 0) { - std::cout << "VMapManager2: unloading file '" << filename << "'.\n"; + sLog.outDebug("VMapManager2: unloading file '%s'", filename.c_str()); delete model->second.getModel(); iLoadedModelFiles.erase(model); } diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index 5f03b87b07f..953a8f11fa7 100644 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -20,8 +20,8 @@ #define _VMAPMANAGER2_H #include "IVMapManager.h" -#include "Utilities/UnorderedMap.h" -#include "Platform/Define.h" +#include "Dynamic/UnorderedMap.h" +#include "Define.h" #include <G3D/Vector3.h> //=========================================================== |
