diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 46acb9401..1065da900 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -8447,7 +8447,7 @@ uint32 ObjectMgr::GetScriptId(const char *name) ScriptNameMap::const_iterator itr = std::lower_bound(m_scriptNames.begin(), m_scriptNames.end(), name); if(itr == m_scriptNames.end() || *itr != name) return 0; - return itr - m_scriptNames.begin(); + return uint32(itr - m_scriptNames.begin()); } void ObjectMgr::CheckScripts(ScriptMapMap const& scripts,std::set& ids) diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 7e8165b5f..769ebcaa9 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -259,7 +259,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool m_charmInfo->LoadPetActionBar(fields[13].GetCppString()); // since last save (in seconds) - uint32 timediff = uint32(time(NULL) - fields[14].GetUInt32()); + uint32 timediff = uint32(time(NULL) - fields[14].GetUInt64()); m_resetTalentsCost = fields[15].GetUInt32(); m_resetTalentsTime = fields[16].GetUInt64(); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 33c00c15a..2da5207ec 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -12038,27 +12038,27 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool case ITEM_MOD_AGILITY: sLog.outDebug("+ %u AGILITY",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply); - ApplyStatBuffMod(STAT_AGILITY, enchant_amount, apply); + ApplyStatBuffMod(STAT_AGILITY, float(enchant_amount), apply); break; case ITEM_MOD_STRENGTH: sLog.outDebug("+ %u STRENGTH",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply); - ApplyStatBuffMod(STAT_STRENGTH, enchant_amount, apply); + ApplyStatBuffMod(STAT_STRENGTH, float(enchant_amount), apply); break; case ITEM_MOD_INTELLECT: sLog.outDebug("+ %u INTELLECT",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply); - ApplyStatBuffMod(STAT_INTELLECT, enchant_amount, apply); + ApplyStatBuffMod(STAT_INTELLECT, float(enchant_amount), apply); break; case ITEM_MOD_SPIRIT: sLog.outDebug("+ %u SPIRIT",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply); - ApplyStatBuffMod(STAT_SPIRIT, enchant_amount, apply); + ApplyStatBuffMod(STAT_SPIRIT, float(enchant_amount), apply); break; case ITEM_MOD_STAMINA: sLog.outDebug("+ %u STAMINA",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply); - ApplyStatBuffMod(STAT_STAMINA, enchant_amount, apply); + ApplyStatBuffMod(STAT_STAMINA, float(enchant_amount), apply); break; case ITEM_MOD_DEFENSE_SKILL_RATING: ((Player*)this)->ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 71ca6d362..c5038c9ed 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3506,7 +3506,7 @@ void Aura::HandleAuraTrackStealthed(bool apply, bool /*Real*/) void Aura::HandleAuraModScale(bool apply, bool /*Real*/) { - m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, m_modifier.m_amount, apply); + m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, float(m_modifier.m_amount), apply); } void Aura::HandleModPossess(bool apply, bool Real) @@ -4221,7 +4221,7 @@ void Aura::HandleModThreat(bool apply, bool Real) if (m_target->GetTypeId() == TYPEID_PLAYER) for(int8 x=0;x < MAX_SPELL_SCHOOL;x++) if (m_modifier.m_miscvalue & int32(1<m_threatModifier[x], m_modifier.m_amount, apply); + ApplyPercentModFloatVar(m_target->m_threatModifier[x], float(m_modifier.m_amount), apply); } void Aura::HandleAuraModTotalThreat(bool apply, bool Real) @@ -4888,7 +4888,7 @@ void Aura::HandleAuraModResistanceExclusive(bool apply, bool /*Real*/) { m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(m_modifier.m_amount), apply); if(m_target->GetTypeId() == TYPEID_PLAYER) - m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, m_modifier.m_amount, apply); + m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount), apply); } } } @@ -4901,7 +4901,7 @@ void Aura::HandleAuraModResistance(bool apply, bool /*Real*/) { m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(m_modifier.m_amount), apply); if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet()) - m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, m_modifier.m_amount, apply); + m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount), apply); } } } @@ -4934,8 +4934,8 @@ void Aura::HandleModResistancePercent(bool apply, bool /*Real*/) m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply); if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet()) { - m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, m_modifier.m_amount, apply); - m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, m_modifier.m_amount, apply); + m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, float(m_modifier.m_amount), apply); + m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, float(m_modifier.m_amount), apply); } } } @@ -4978,7 +4978,7 @@ void Aura::HandleAuraModStat(bool apply, bool /*Real*/) //m_target->ApplyStatMod(Stats(i), m_modifier.m_amount,apply); m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(m_modifier.m_amount), apply); if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet()) - m_target->ApplyStatBuffMod(Stats(i), m_modifier.m_amount, apply); + m_target->ApplyStatBuffMod(Stats(i), float(m_modifier.m_amount), apply); } } } @@ -5078,7 +5078,7 @@ void Aura::HandleModTotalPercentStat(bool apply, bool /*Real*/) { m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply); if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet()) - m_target->ApplyStatPercentBuffMod(Stats(i), m_modifier.m_amount, apply ); + m_target->ApplyStatPercentBuffMod(Stats(i), float(m_modifier.m_amount), apply ); } } @@ -5430,22 +5430,22 @@ void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real) void Aura::HandleModCastingSpeed(bool apply, bool /*Real*/) { - m_target->ApplyCastTimePercentMod(m_modifier.m_amount,apply); + m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount),apply); } void Aura::HandleModMeleeRangedSpeedPct(bool apply, bool /*Real*/) { - m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount, apply); - m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount, apply); - m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply); + m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply); + m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply); + m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); } void Aura::HandleModCombatSpeedPct(bool apply, bool /*Real*/) { - m_target->ApplyCastTimePercentMod(m_modifier.m_amount, apply); - m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount, apply); - m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount, apply); - m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply); + m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount), apply); + m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply); + m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply); + m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); } void Aura::HandleModAttackSpeed(bool apply, bool /*Real*/) @@ -5453,26 +5453,26 @@ void Aura::HandleModAttackSpeed(bool apply, bool /*Real*/) if(!m_target->isAlive() ) return; - m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply); + m_target->ApplyAttackTimePercentMod(BASE_ATTACK,float(m_modifier.m_amount),apply); } void Aura::HandleHaste(bool apply, bool /*Real*/) { - m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount, apply); - m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount, apply); - m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply); + m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply); + m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply); + m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); } void Aura::HandleAuraModRangedHaste(bool apply, bool /*Real*/) { - m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply); + m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); } void Aura::HandleRangedAmmoHaste(bool apply, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; - m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_modifier.m_amount, apply); + m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); } /********************************/ diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 3031c163a..f1b305816 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8996,8 +8996,8 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 if (Aura *dummy = pVictim->GetDummyAura(45182)) { float mod = -((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2*4; - if (mod < dummy->GetModifier()->m_amount) - mod = dummy->GetModifier()->m_amount; + if (mod < float(dummy->GetModifier()->m_amount)) + mod = float(dummy->GetModifier()->m_amount); TakenTotalMod *= (mod+100.0f)/100.0f; } } @@ -9182,7 +9182,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM crit_chance = GetFloatValue( PLAYER_SPELL_CRIT_PERCENTAGE1 + GetFirstSchoolInMask(schoolMask)); else { - crit_chance = m_baseSpellCritChance; + crit_chance = float(m_baseSpellCritChance); crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, schoolMask); } // taken @@ -9383,18 +9383,18 @@ int32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, int32 float TakenTotalMod = 1.0f; // Healing taken percent - float minval = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + float minval = float(pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT)); if(minval) TakenTotalMod *= (100.0f + minval) / 100.0f; - float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + float maxval = float(pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT)); if(maxval) TakenTotalMod *= (100.0f + maxval) / 100.0f; // No heal amount for this class spells if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) { - healamount = healamount * int32(TakenTotalMod); + healamount = int32(healamount * TakenTotalMod); return healamount < 0 ? 0 : healamount; } @@ -9912,8 +9912,8 @@ uint32 Unit::MeleeDamageBonus(Unit *pVictim, uint32 pdamage,WeaponAttackType att continue; float mod = ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*(-8.0f); - if (mod < (*i)->GetModifier()->m_amount) - mod = (*i)->GetModifier()->m_amount; + if (mod < float((*i)->GetModifier()->m_amount)) + mod = float((*i)->GetModifier()->m_amount); TakenPercent *= (mod + 100.0f) / 100.0f; } @@ -10084,7 +10084,8 @@ float Unit::GetWeaponProcChance() const float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM) const { // proc per minute chance calculation - if (PPM <= 0.0f) return 0.0f; + if (PPM <= 0.0f) + return 0.0f; return WeaponSpeed * PPM / 600.0f; // result is chance in percents (probability = Speed_in_sec * (PPM / 60)) } diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 625049f52..acc4faf9e 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -545,7 +545,7 @@ int WorldSocket::handle_input_missing_data (void) recv_size); if (n <= 0) - return n; + return (int)n; message_block.wr_ptr (n); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5c300dc7d..a44311ad6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9396" + #define REVISION_NR "9397" #endif // __REVISION_NR_H__