Core/Misc: Fix issues reported by static analysis (#25351)
* Core/Misc: Fix issues reported by static analysis
* Core/Vmaps: Code cleanup after e777161888
# Conflicts:
# src/common/Collision/DynamicTree.cpp
# src/server/game/Entities/Object/Object.cpp
# src/server/game/World/World.cpp
This commit is contained in:
1 parent
85018f9421
commit
6a8ecc3ee3
10 files changed
+17
-18
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void LoadGameObjectModelList(std::string const& dataPath)
|
||||
GameObjectModel::~GameObjectModel()
|
||||
{
|
||||
if (iModel)
|
||||
((VMAP::VMapManager2*)VMAP::VMapFactory::createOrGetVMapManager())->releaseModelInstance(name);
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->releaseModelInstance(name);
|
||||
}
|
||||
|
||||
bool GameObjectModel::initialize(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string const& dataPath)
|
||||
@@ -116,7 +116,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;
|
||||
|
||||
@@ -215,9 +215,7 @@ void UnitAI::FillAISpellInfo()
|
||||
if (AIInfo->cooldown < spellInfo->RecoveryTime)
|
||||
AIInfo->cooldown = spellInfo->RecoveryTime;
|
||||
|
||||
if (!spellInfo->GetMaxRange(false))
|
||||
UPDATE_TARGET(AITARGET_SELF)
|
||||
else
|
||||
if (spellInfo->GetMaxRange(false))
|
||||
{
|
||||
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "Weather.h"
|
||||
#include "WeatherMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "World.h"
|
||||
|
||||
MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
@@ -1619,11 +1619,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 = &DBCManager::GetLiquidFlags;
|
||||
vmmgr2->IsVMAPDisabledForPtr = &DisableMgr::IsVMAPDisabledFor;
|
||||
}
|
||||
VMAP::VMapManager2* vmmgr2 = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
vmmgr2->GetLiquidFlagsPtr = &DBCManager::GetLiquidFlags;
|
||||
vmmgr2->IsVMAPDisabledForPtr = &DisableMgr::IsVMAPDisabledFor;
|
||||
|
||||
///- Initialize config settings
|
||||
LoadConfigSettings();
|
||||
@@ -1701,9 +1699,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);
|
||||
|
||||
@@ -39,6 +39,7 @@ EndScriptData */
|
||||
#include "UpdateTime.h"
|
||||
#include "Util.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
|
||||
Reference in new issue
Block a user