mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Core/Misc: Fix static analysis issues reported by Coverity
This commit is contained in:
@@ -117,6 +117,7 @@ GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_respawnTime = 0;
|
||||
m_respawnDelayTime = 300;
|
||||
m_despawnDelay = 0;
|
||||
m_despawnRespawnTime = 0s;
|
||||
m_lootState = GO_NOT_READY;
|
||||
m_spawnedByDefault = true;
|
||||
m_usetimes = 0;
|
||||
|
||||
@@ -965,7 +965,7 @@ void MovementInfo::OutDebug()
|
||||
|
||||
WorldObject::WorldObject(bool isWorldObject) : Object(), WorldLocation(), LastUsedScriptID(0),
|
||||
m_movementInfo(), m_name(), m_isActive(false), m_isFarVisible(false), m_isWorldObject(isWorldObject), m_zoneScript(nullptr),
|
||||
m_transport(nullptr), m_zoneId(0), m_areaId(0), m_staticFloorZ(VMAP_INVALID_HEIGHT), m_currMap(nullptr), m_InstanceId(0),
|
||||
m_transport(nullptr), m_zoneId(0), m_areaId(0), m_staticFloorZ(VMAP_INVALID_HEIGHT), m_outdoors(false), m_currMap(nullptr), m_InstanceId(0),
|
||||
m_phaseMask(PHASEMASK_NORMAL), m_notifyflags(0)
|
||||
{
|
||||
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE | GHOST_VISIBILITY_GHOST);
|
||||
|
||||
@@ -15748,7 +15748,7 @@ bool Player::GiveQuestSourceItem(Quest const* quest)
|
||||
if (srcitem > 0)
|
||||
{
|
||||
// Don't give source item if it is the same item used to start the quest
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(srcitem);
|
||||
ItemTemplate const* itemTemplate = ASSERT_NOTNULL(sObjectMgr->GetItemTemplate(srcitem));
|
||||
if (quest->GetQuestId() == itemTemplate->StartQuest)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -10934,6 +10934,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
|
||||
else // creature died
|
||||
{
|
||||
TC_LOG_DEBUG("entities.unit", "DealDamageNotPlayer");
|
||||
ASSERT_NODEBUGINFO(creature);
|
||||
|
||||
if (!creature->IsPet())
|
||||
{
|
||||
|
||||
@@ -378,6 +378,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
|
||||
if (!_worldSession)
|
||||
{
|
||||
TC_LOG_ERROR("network.opcode", "ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
|
||||
delete packetToQueue;
|
||||
return ReadDataHandlerResult::Error;
|
||||
}
|
||||
|
||||
@@ -385,6 +386,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
|
||||
if (!handler)
|
||||
{
|
||||
TC_LOG_ERROR("network.opcode", "No defined handler for opcode %s sent by %s", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet.GetOpcode())).c_str(), _worldSession->GetPlayerInfo().c_str());
|
||||
delete packetToQueue;
|
||||
return ReadDataHandlerResult::Error;
|
||||
}
|
||||
|
||||
|
||||
@@ -2714,6 +2714,7 @@ DynObjAura::DynObjAura(AuraCreateInfo const& createInfo)
|
||||
LoadScripts();
|
||||
ASSERT(GetDynobjOwner());
|
||||
ASSERT(GetDynobjOwner()->IsInWorld());
|
||||
ASSERT(createInfo.Caster);
|
||||
ASSERT(GetDynobjOwner()->GetMap() == createInfo.Caster->GetMap());
|
||||
_InitEffects(createInfo._auraEffectMask, createInfo.Caster, createInfo.BaseAmount);
|
||||
GetDynobjOwner()->SetAura(this);
|
||||
|
||||
@@ -49,6 +49,8 @@ uint32 UpdateTime::GetTimeWeightedAverageUpdateTime() const
|
||||
sum += diff * diff;
|
||||
weightsum += diff;
|
||||
}
|
||||
if (weightsum == 0)
|
||||
return 0;
|
||||
return sum / weightsum;
|
||||
}
|
||||
|
||||
|
||||
@@ -3729,7 +3729,7 @@ class spell_item_mirrens_drinking_hat : public SpellScript
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
uint32 spellId;
|
||||
uint32 spellId = 0;
|
||||
switch (urand(1, 6))
|
||||
{
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user