Core: Fix more warnings
--HG-- branch : trunk
This commit is contained in:
1 parent
b0d85ac185
commit
405f312918
103 files changed
+564
-468
No files matched your search
@@ -3274,7 +3274,11 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
|
||||
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
|
||||
|
||||
// weapon skill or (unarmed for base attack and fist weapons)
|
||||
uint32 skill = item && item->GetSkill() != SKILL_FIST_WEAPONS ? item->GetSkill() : SKILL_UNARMED;
|
||||
uint32 skill;
|
||||
if (item && item->GetSkill() != SKILL_FIST_WEAPONS)
|
||||
skill = item->GetSkill();
|
||||
else
|
||||
skill = SKILL_UNARMED;
|
||||
|
||||
// in PvP use full skill instead current skill value
|
||||
value = (target && target->IsControlledByPlayer())
|
||||
@@ -7350,9 +7354,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
{
|
||||
if (ToPlayer()->HasSpellCooldown(16166))
|
||||
{
|
||||
uint32 newCooldownDelay = ToPlayer()->GetSpellCooldownDelay(16166) - 2;
|
||||
if (newCooldownDelay < 0) newCooldownDelay = 0;
|
||||
ToPlayer()->AddSpellCooldown(16166,0, uint32(time(NULL) + newCooldownDelay));
|
||||
uint32 newCooldownDelay = ToPlayer()->GetSpellCooldownDelay(16166);
|
||||
if (newCooldownDelay < 3)
|
||||
newCooldownDelay = 0;
|
||||
else
|
||||
newCooldownDelay -= 2;
|
||||
ToPlayer()->AddSpellCooldown(16166,0, uint32(time(NULL) + newCooldownDelay));
|
||||
|
||||
WorldPacket data(SMSG_MODIFY_COOLDOWN, 4+8+4);
|
||||
data << uint32(16166); // Spell ID
|
||||
@@ -9636,7 +9643,7 @@ Guardian* Unit::GetGuardianPet() const
|
||||
if (pet->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
|
||||
return (Guardian*)pet;
|
||||
|
||||
sLog.outCrash("Unit::GetGuardianPet: Guardian " I64FMT " not exist.", pet_guid);
|
||||
sLog.outCrash("Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid);
|
||||
const_cast<Unit*>(this)->SetPetGUID(0);
|
||||
}
|
||||
|
||||
@@ -9848,7 +9855,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!AddUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
|
||||
sLog.outCrash("Player %s is trying to charm unit %u, but it already has a charmed unit %u", GetName(), charm->GetEntry(), GetCharmGUID());
|
||||
sLog.outCrash("Player %s is trying to charm unit %u, but it already has a charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
|
||||
|
||||
charm->m_ControlledByPlayer = true;
|
||||
// TODO: maybe we can use this flag to check if controlled by player
|
||||
@@ -9861,7 +9868,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
|
||||
|
||||
if (!charm->AddUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
|
||||
sLog.outCrash("Unit %u is being charmed, but it already has a charmer %u", charm->GetEntry(), charm->GetCharmerGUID());
|
||||
sLog.outCrash("Unit %u is being charmed, but it already has a charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
|
||||
|
||||
if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
|
||||
{
|
||||
@@ -9876,11 +9883,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!RemoveUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
|
||||
sLog.outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit %u", GetName(), charm->GetEntry(), GetCharmGUID());
|
||||
sLog.outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
|
||||
}
|
||||
|
||||
if (!charm->RemoveUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
|
||||
sLog.outCrash("Unit %u is being uncharmed, but it has another charmer %u", charm->GetEntry(), charm->GetCharmerGUID());
|
||||
sLog.outCrash("Unit %u is being uncharmed, but it has another charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
|
||||
|
||||
if (charm->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -10011,11 +10018,11 @@ void Unit::RemoveAllControlled()
|
||||
sLog.outError("Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
|
||||
}
|
||||
if (GetPetGUID())
|
||||
sLog.outCrash("Unit %u is not able to release its pet " I64FMT, GetEntry(), GetPetGUID());
|
||||
sLog.outCrash("Unit %u is not able to release its pet " UI64FMTD, GetEntry(), GetPetGUID());
|
||||
if (GetMinionGUID())
|
||||
sLog.outCrash("Unit %u is not able to release its minion " I64FMT, GetEntry(), GetMinionGUID());
|
||||
sLog.outCrash("Unit %u is not able to release its minion " UI64FMTD, GetEntry(), GetMinionGUID());
|
||||
if (GetCharmGUID())
|
||||
sLog.outCrash("Unit %u is not able to release its charm " I64FMT, GetEntry(), GetCharmGUID());
|
||||
sLog.outCrash("Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID());
|
||||
}
|
||||
|
||||
Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
|
||||
@@ -11117,7 +11124,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
|
||||
for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
if (spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH ||
|
||||
spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH)
|
||||
(spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH))
|
||||
{
|
||||
CastingTime /= 2;
|
||||
break;
|
||||
@@ -14718,7 +14725,7 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
|
||||
{
|
||||
Player* player = GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
if (!player || (attackedPlayer && (attackedPlayer == player || player->duel && player->duel->opponent == attackedPlayer)))
|
||||
if (!player || (attackedPlayer && (attackedPlayer == player || (player->duel && player->duel->opponent == attackedPlayer))))
|
||||
return;
|
||||
|
||||
player->SetContestedPvPTimer(30000);
|
||||
@@ -15179,7 +15186,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
// only if not player and not controlled by player pet. And not at BG
|
||||
if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
|
||||
{
|
||||
sLog.outStaticDebug("We are dead, losing %u percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
sLog.outStaticDebug("We are dead, losing %f percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false);
|
||||
// durability lost message
|
||||
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
||||
|
||||
Reference in new issue
Block a user