mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[9324] Fix some gcc warnings
This commit is contained in:
parent
2a01c79609
commit
4338c9105d
27 changed files with 102 additions and 103 deletions
|
|
@ -707,7 +707,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
|||
continue;
|
||||
|
||||
// BuyCount by default
|
||||
uint32 count = iProto->BuyCount;
|
||||
int32 count = iProto->BuyCount;
|
||||
|
||||
// special amount for foor/drink
|
||||
if(iProto->Class==ITEM_CLASS_CONSUMABLE && iProto->SubClass==ITEM_SUBCLASS_FOOD)
|
||||
|
|
@ -901,13 +901,13 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
|||
switch (timer)
|
||||
{
|
||||
case FATIGUE_TIMER:
|
||||
if (GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_TIMERBAR_FATIGUE_GMLEVEL))
|
||||
if (GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_TIMERBAR_FATIGUE_GMLEVEL))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
return sWorld.getConfig(CONFIG_TIMERBAR_FATIGUE_MAX)*IN_MILISECONDS;
|
||||
case BREATH_TIMER:
|
||||
{
|
||||
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) ||
|
||||
GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_TIMERBAR_BREATH_GMLEVEL))
|
||||
GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_TIMERBAR_BREATH_GMLEVEL))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
int32 UnderWaterTime = sWorld.getConfig(CONFIG_TIMERBAR_BREATH_MAX)*IN_MILISECONDS;
|
||||
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
|
||||
|
|
@ -917,7 +917,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
|||
}
|
||||
case FIRE_TIMER:
|
||||
{
|
||||
if (!isAlive() || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_TIMERBAR_FIRE_GMLEVEL))
|
||||
if (!isAlive() || GetSession()->GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_TIMERBAR_FIRE_GMLEVEL))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
return sWorld.getConfig(CONFIG_TIMERBAR_FIRE_MAX)*IN_MILISECONDS;
|
||||
}
|
||||
|
|
@ -2090,7 +2090,7 @@ void Player::RegenerateHealth(uint32 diff)
|
|||
|
||||
// polymorphed case
|
||||
if ( IsPolymorphed() )
|
||||
addvalue = GetMaxHealth()/3;
|
||||
addvalue = (float)GetMaxHealth()/3;
|
||||
// normal regen case (maybe partly in combat case)
|
||||
else if (!isInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT) )
|
||||
{
|
||||
|
|
@ -5980,7 +5980,7 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in
|
|||
if (rate != 1.0f && creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel()))
|
||||
percent *= rate;
|
||||
|
||||
float repMod = GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN);
|
||||
float repMod = (float)GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN);
|
||||
|
||||
if (!for_quest)
|
||||
repMod += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_FACTION_REPUTATION_GAIN, faction);
|
||||
|
|
@ -6648,7 +6648,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
|||
if (only_level_scale && !ssv)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
{
|
||||
uint32 statType = 0;
|
||||
int32 val = 0;
|
||||
|
|
@ -7142,7 +7142,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
|
|||
if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
|
||||
return;
|
||||
|
||||
float chance = spellInfo->procChance;
|
||||
float chance = (float)spellInfo->procChance;
|
||||
|
||||
if(spellData.SpellPPMRate)
|
||||
{
|
||||
|
|
@ -8627,7 +8627,7 @@ Item* Player::GetItemByPos( uint8 bag, uint8 slot ) const
|
|||
|
||||
Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool nonbroken, bool useable) const
|
||||
{
|
||||
uint16 slot;
|
||||
uint8 slot;
|
||||
switch (attackType)
|
||||
{
|
||||
case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break;
|
||||
|
|
@ -11483,7 +11483,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
|||
|
||||
uint32 count = 0;
|
||||
|
||||
for(int i=0; i < fullBag->GetBagSize(); ++i)
|
||||
for(uint32 i=0; i < fullBag->GetBagSize(); ++i)
|
||||
{
|
||||
Item *bagItem = fullBag->GetItemByPos(i);
|
||||
if (!bagItem)
|
||||
|
|
@ -11510,7 +11510,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
|||
|
||||
// Items swap
|
||||
count = 0; // will pos in new bag
|
||||
for(int i = 0; i< fullBag->GetBagSize(); ++i)
|
||||
for(uint32 i = 0; i< fullBag->GetBagSize(); ++i)
|
||||
{
|
||||
Item *bagItem = fullBag->GetItemByPos(i);
|
||||
if (!bagItem)
|
||||
|
|
@ -15222,10 +15222,10 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff)
|
|||
uint32 spellid = fields[1].GetUInt32();
|
||||
uint32 effindex = fields[2].GetUInt32();
|
||||
uint32 stackcount = fields[3].GetUInt32();
|
||||
int32 damage = (int32)fields[4].GetUInt32();
|
||||
int32 maxduration = (int32)fields[5].GetUInt32();
|
||||
int32 remaintime = (int32)fields[6].GetUInt32();
|
||||
int32 remaincharges = (int32)fields[7].GetUInt32();
|
||||
int32 damage = fields[4].GetInt32();
|
||||
int32 maxduration = fields[5].GetInt32();
|
||||
int32 remaintime = fields[6].GetInt32();
|
||||
int32 remaincharges = fields[7].GetInt32();
|
||||
|
||||
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
|
||||
if(!spellproto)
|
||||
|
|
@ -15252,7 +15252,7 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff)
|
|||
// prevent wrong values of remaincharges
|
||||
if(spellproto->procCharges)
|
||||
{
|
||||
if(remaincharges <= 0 || remaincharges > spellproto->procCharges)
|
||||
if(remaincharges <= 0 || remaincharges > (int32)spellproto->procCharges)
|
||||
remaincharges = spellproto->procCharges;
|
||||
}
|
||||
else
|
||||
|
|
@ -20679,7 +20679,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
|
|||
return;
|
||||
|
||||
// find current max talent rank
|
||||
int32 curtalent_maxrank = 0;
|
||||
uint32 curtalent_maxrank = 0;
|
||||
for(int32 k = MAX_TALENT_RANK-1; k > -1; --k)
|
||||
{
|
||||
if(talentInfo->RankID[k] && HasSpell(talentInfo->RankID[k]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue