aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/Collision/DynamicTree.cpp2
-rw-r--r--src/common/Collision/Management/VMapFactory.cpp6
-rw-r--r--src/common/Collision/Management/VMapFactory.h4
-rw-r--r--src/common/Collision/Models/GameObjectModel.cpp4
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp4
-rw-r--r--src/server/game/Entities/Object/Object.cpp1
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp1
-rw-r--r--src/server/game/Maps/Map.cpp1
-rw-r--r--src/server/game/Maps/MapInstanced.cpp1
-rw-r--r--src/server/game/Spells/Spell.cpp1
-rw-r--r--src/server/game/World/World.cpp11
-rw-r--r--src/server/scripts/Commands/cs_server.cpp1
12 files changed, 19 insertions, 18 deletions
diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp
index c7e3d4b4ed0..2aa47912528 100644
--- a/src/common/Collision/DynamicTree.cpp
+++ b/src/common/Collision/DynamicTree.cpp
@@ -293,7 +293,7 @@ void DynamicMapTree::getAreaAndLiquidData(float x, float y, float z, PhaseShift
data.floorZ = intersectionCallBack.GetLocationInfo().ground_Z;
uint32 liquidType = intersectionCallBack.GetLocationInfo().hitModel->GetLiquidType();
float liquidLevel;
- if (!reqLiquidType || (dynamic_cast<VMAP::VMapManager2*>(VMAP::VMapFactory::createOrGetVMapManager())->GetLiquidFlagsPtr(liquidType) & reqLiquidType))
+ if (!reqLiquidType || VMAP::VMapFactory::createOrGetVMapManager()->GetLiquidFlagsPtr(liquidType) & reqLiquidType)
if (intersectionCallBack.GetHitModel()->GetLiquidLevel(v, intersectionCallBack.GetLocationInfo(), liquidLevel))
data.liquidInfo.emplace(liquidType, liquidLevel);
diff --git a/src/common/Collision/Management/VMapFactory.cpp b/src/common/Collision/Management/VMapFactory.cpp
index 7d951fba12e..191f33a7663 100644
--- a/src/common/Collision/Management/VMapFactory.cpp
+++ b/src/common/Collision/Management/VMapFactory.cpp
@@ -20,14 +20,14 @@
namespace VMAP
{
- IVMapManager* gVMapManager = nullptr;
+ VMapManager2* gVMapManager = nullptr;
//===============================================
// just return the instance
- IVMapManager* VMapFactory::createOrGetVMapManager()
+ VMapManager2* VMapFactory::createOrGetVMapManager()
{
if (gVMapManager == nullptr)
- gVMapManager= new VMapManager2(); // should be taken from config ... Please change if you like :-)
+ gVMapManager= new VMapManager2();
return gVMapManager;
}
diff --git a/src/common/Collision/Management/VMapFactory.h b/src/common/Collision/Management/VMapFactory.h
index ae07484561e..ceb07fce975 100644
--- a/src/common/Collision/Management/VMapFactory.h
+++ b/src/common/Collision/Management/VMapFactory.h
@@ -26,12 +26,12 @@ This is the access point to the VMapManager.
namespace VMAP
{
- //===========================================================
+ class VMapManager2;
class TC_COMMON_API VMapFactory
{
public:
- static IVMapManager* createOrGetVMapManager();
+ static VMapManager2* createOrGetVMapManager();
static void clear();
};
diff --git a/src/common/Collision/Models/GameObjectModel.cpp b/src/common/Collision/Models/GameObjectModel.cpp
index 65a530e7c0e..bcbfed28f32 100644
--- a/src/common/Collision/Models/GameObjectModel.cpp
+++ b/src/common/Collision/Models/GameObjectModel.cpp
@@ -98,7 +98,7 @@ void LoadGameObjectModelList(std::string const& dataPath)
GameObjectModel::~GameObjectModel()
{
if (iModel)
- ((VMAP::VMapManager2*)VMAP::VMapFactory::createOrGetVMapManager())->releaseModelInstance(iModel->GetName());
+ VMAP::VMapFactory::createOrGetVMapManager()->releaseModelInstance(iModel->GetName());
}
bool GameObjectModel::initialize(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string const& dataPath)
@@ -115,7 +115,7 @@ bool GameObjectModel::initialize(std::unique_ptr<GameObjectModelOwnerBase> model
return false;
}
- iModel = ((VMAP::VMapManager2*)VMAP::VMapFactory::createOrGetVMapManager())->acquireModelInstance(dataPath + "vmaps/", it->second.name);
+ iModel = VMAP::VMapFactory::createOrGetVMapManager()->acquireModelInstance(dataPath + "vmaps/", it->second.name);
if (!iModel)
return false;
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index bf4457caa86..243d45fdcb6 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -201,9 +201,7 @@ void UnitAI::FillAISpellInfo()
if (AIInfo->cooldown.count() < int32(spellInfo->RecoveryTime))
AIInfo->cooldown = Milliseconds(spellInfo->RecoveryTime);
- if (!spellInfo->GetMaxRange(false))
- UPDATE_TARGET(AITARGET_SELF)
- else
+ if (spellInfo->GetMaxRange(false))
{
for (SpellEffectInfo const& effect : spellInfo->GetEffects())
{
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 0831c4e4fb4..1ac5fc71a49 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -54,6 +54,7 @@
#include "Util.h"
#include "VMapFactory.h"
#include "Vehicle.h"
+#include "VMapManager2.h"
#include "World.h"
#include "WorldSession.h"
#include <G3D/Vector3.h>
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index f92c7390848..3b6d5c29153 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -64,6 +64,7 @@
#include "TransportMgr.h"
#include "Vehicle.h"
#include "VMapFactory.h"
+#include "VMapManager2.h"
#include "World.h"
#include <G3D/g3dmath.h>
#include <numeric>
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 3caa5e30ad1..26ade43a1de 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -50,6 +50,7 @@
#include "Transport.h"
#include "Vehicle.h"
#include "VMapFactory.h"
+#include "VMapManager2.h"
#include "Weather.h"
#include "WeatherMgr.h"
#include "World.h"
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index ee4e0c0a20c..32aac9c1878 100644
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -28,6 +28,7 @@
#include "Player.h"
#include "ScenarioMgr.h"
#include "VMapFactory.h"
+#include "VMapManager2.h"
#include "World.h"
MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DIFFICULTY_NORMAL)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 03c1fc92a9e..b6cafb07edf 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -55,6 +55,7 @@
#include "Util.h"
#include "VMapFactory.h"
#include "Vehicle.h"
+#include "VMapManager2.h"
#include "World.h"
#include "WorldSession.h"
#include <numeric>
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 6f5681b0bb6..9e03fa5ad10 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1689,11 +1689,9 @@ void World::SetInitialWorldSettings()
dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
///- Initialize VMapManager function pointers (to untangle game/collision circular deps)
- if (VMAP::VMapManager2* vmmgr2 = dynamic_cast<VMAP::VMapManager2*>(VMAP::VMapFactory::createOrGetVMapManager()))
- {
- vmmgr2->GetLiquidFlagsPtr = &DB2Manager::GetLiquidFlags;
- vmmgr2->IsVMAPDisabledForPtr = &DisableMgr::IsVMAPDisabledFor;
- }
+ VMAP::VMapManager2* vmmgr2 = VMAP::VMapFactory::createOrGetVMapManager();
+ vmmgr2->GetLiquidFlagsPtr = &DB2Manager::GetLiquidFlags;
+ vmmgr2->IsVMAPDisabledForPtr = &DisableMgr::IsVMAPDisabledFor;
///- Initialize config settings
LoadConfigSettings();
@@ -1785,8 +1783,7 @@ void World::SetInitialWorldSettings()
sMapMgr->InitializeParentMapData(mapData);
- if (VMAP::VMapManager2* vmmgr2 = dynamic_cast<VMAP::VMapManager2*>(VMAP::VMapFactory::createOrGetVMapManager()))
- vmmgr2->InitializeThreadUnsafe(mapData);
+ vmmgr2->InitializeThreadUnsafe(mapData);
MMAP::MMapManager* mmmgr = MMAP::MMapFactory::createOrGetMMapManager();
mmmgr->InitializeThreadUnsafe(mapData);
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index d9cc9e3aa1f..1add2091a97 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -39,6 +39,7 @@ EndScriptData */
#include "UpdateTime.h"
#include "Util.h"
#include "VMapFactory.h"
+#include "VMapManager2.h"
#include "World.h"
#include "WorldSession.h"