Core/Misc: Silence some statis analysis false positive warnings

(cherry picked from commit fe788a5eeb)
This commit is contained in:
Shauren
2025-05-19 14:41:23 +02:00
committed by Ovahlord
parent 5e2fb0d520
commit 5b3d7604e5
4 changed files with 25 additions and 14 deletions

View File

@@ -39,12 +39,12 @@ struct MmapTileHeader
// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
static_assert(sizeof(MmapTileHeader) == 20, "MmapTileHeader size is not correct, adjust the padding field size");
static_assert(sizeof(MmapTileHeader) == (sizeof(MmapTileHeader::mmapMagic) +
sizeof(MmapTileHeader::dtVersion) +
sizeof(MmapTileHeader::mmapVersion) +
sizeof(MmapTileHeader::size) +
sizeof(MmapTileHeader::usesLiquids) +
sizeof(MmapTileHeader::padding)), "MmapTileHeader has uninitialized padding fields");
static_assert(sizeof(MmapTileHeader) == sizeof(MmapTileHeader::mmapMagic) +
sizeof(MmapTileHeader::dtVersion) +
sizeof(MmapTileHeader::mmapVersion) +
sizeof(MmapTileHeader::size) +
sizeof(MmapTileHeader::usesLiquids) +
sizeof(MmapTileHeader::padding), "MmapTileHeader has uninitialized padding fields");
enum NavArea
{

View File

@@ -30,7 +30,7 @@ enum PetType : uint8
{
SUMMON_PET = 0,
HUNTER_PET = 1,
MAX_PET_TYPE = 4
MAX_PET_TYPE
};
#define MAX_ACTIVE_PETS 5

View File

@@ -2948,7 +2948,7 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled /*= false*/, bool learn_
RemovePetAura(petSpell);
// update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning)
if (spellInfo && spellInfo->IsPrimaryProfessionFirstRank())
if (spellInfo->IsPrimaryProfessionFirstRank())
{
uint32 freeProfs = GetFreePrimaryProfessionPoints()+1;
if (freeProfs <= sWorld->getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
@@ -3085,7 +3085,7 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled /*= false*/, bool learn_
if (m_canTitanGrip)
{
if (spellInfo && spellInfo->IsPassive() && spellInfo->HasEffect(SPELL_EFFECT_TITAN_GRIP))
if (spellInfo->IsPassive() && spellInfo->HasEffect(SPELL_EFFECT_TITAN_GRIP))
{
RemoveAurasDueToSpell(m_titanGripPenaltySpellId);
SetCanTitanGrip(false);
@@ -3094,7 +3094,7 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled /*= false*/, bool learn_
if (m_canDualWield)
{
if (spellInfo && spellInfo->IsPassive() && spellInfo->HasEffect(SPELL_EFFECT_DUAL_WIELD))
if (spellInfo->IsPassive() && spellInfo->HasEffect(SPELL_EFFECT_DUAL_WIELD))
SetCanDualWield(false);
}
@@ -13671,7 +13671,7 @@ Quest const* Player::GetNextQuest(Object const* questGiver, Quest const* quest)
//we should obtain map pointer from GetMap() in 99% of cases. Special case
//only for quests which cast teleport spells on player
if (WorldObject const* worldObjectQuestGiver = dynamic_cast<WorldObject const*>(questGiver))
if (WorldObject const* worldObjectQuestGiver = questGiver->ToWorldObject())
if (!IsInMap(worldObjectQuestGiver))
return nullptr;

View File

@@ -7872,9 +7872,20 @@ void Spell::DelayedChannel()
m_timer -= delaytime;
for (TargetInfo const& targetInfo : m_UniqueTargetInfo)
if (targetInfo.MissCondition == SPELL_MISS_NONE)
if (Unit* unit = (unitCaster->GetGUID() == targetInfo.TargetGUID) ? unitCaster : ObjectAccessor::GetUnit(*unitCaster, targetInfo.TargetGUID))
unit->DelayOwnedAuras(m_spellInfo->Id, m_originalCasterGUID, delaytime);
{
if (targetInfo.MissCondition != SPELL_MISS_NONE)
continue;
Unit* unit = unitCaster;
if (unitCaster->GetGUID() != targetInfo.TargetGUID)
{
unit = ObjectAccessor::GetUnit(*unitCaster, targetInfo.TargetGUID);
if (!unit)
continue;
}
unit->DelayOwnedAuras(m_spellInfo->Id, m_originalCasterGUID, delaytime);
}
// partially interrupt persistent area auras
if (DynamicObject* dynObj = unitCaster->GetDynObject(m_spellInfo->Id))