mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: Fix static analysis issues
Fix some static analysis issues reported by Coverity
This commit is contained in:
@@ -1316,7 +1316,10 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
|
||||
}
|
||||
|
||||
if (!assigned)
|
||||
{
|
||||
delete sharedList;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sharedList->push_back(cond);
|
||||
break;
|
||||
|
||||
@@ -631,7 +631,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
// Rage from Damage made (only from direct weapon damage)
|
||||
if (cleanDamage && damagetype == DIRECT_DAMAGE && this != victim && getPowerType() == POWER_RAGE)
|
||||
{
|
||||
uint32 rage = uint32(GetAttackTime(cleanDamage->attackType) / 1000 * 8.125f);
|
||||
uint32 rage = uint32(GetAttackTime(cleanDamage->attackType) / 1000.f * 8.125f);
|
||||
switch (cleanDamage->attackType)
|
||||
{
|
||||
case OFF_ATTACK:
|
||||
|
||||
@@ -327,6 +327,9 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint32 effMask, WorldObject* own
|
||||
else
|
||||
casterGUID = caster->GetGUID();
|
||||
|
||||
// at this point of Aura::Create() there MUST be a valid caster
|
||||
ASSERT(caster);
|
||||
|
||||
// check if aura can be owned by owner
|
||||
if (owner->isType(TYPEMASK_UNIT))
|
||||
if (!owner->IsInWorld() || ((Unit*)owner)->IsDuringRemoveFromWorld())
|
||||
|
||||
@@ -2292,7 +2292,10 @@ namespace Trinity
|
||||
va_end(ap);
|
||||
}
|
||||
else
|
||||
std::strcpy(strBuffer, text);
|
||||
{
|
||||
std::strncpy(strBuffer, text, BufferSize);
|
||||
strBuffer[BufferSize - 1] = '\0';
|
||||
}
|
||||
|
||||
do_helper(dataList, strBuffer);
|
||||
}
|
||||
|
||||
@@ -513,6 +513,7 @@ char* DB2DatabaseLoader::Load(const char* format, int32 preparedStatement, uint3
|
||||
{
|
||||
LocalizedString** slot = (LocalizedString**)(&dataValue[offset]);
|
||||
*slot = (LocalizedString*)(&stringHolders[stringHoldersRecordPoolSize * rec + stringHolderSize * stringFieldNumInRecord]);
|
||||
ASSERT(*slot);
|
||||
|
||||
// Value in database in main table field must be for enUS locale
|
||||
if (char* str = AddLocaleString(*slot, LOCALE_enUS, fields[f].GetString()))
|
||||
|
||||
Reference in New Issue
Block a user