[7696] Fixed compile warnings

This commit is contained in:
AlexDereka 2009-04-22 17:00:43 +04:00
parent 4fd4cc31d1
commit cc83cac0aa
5 changed files with 19 additions and 19 deletions

View file

@ -3440,7 +3440,7 @@ bool ChatHandler::HandleModifyArenaCommand(const char * args)
bool ChatHandler::HandleReviveCommand(const char* args) bool ChatHandler::HandleReviveCommand(const char* args)
{ {
Player* player = NULL; Player* player = NULL;
uint32 player_guid = 0; uint64 player_guid = 0;
if (*args) if (*args)
{ {

View file

@ -187,7 +187,7 @@ class MANGOS_DLL_SPEC Object
return *(((uint8*)&m_uint32Values[ index ])+offset); return *(((uint8*)&m_uint32Values[ index ])+offset);
} }
uint8 GetUInt16Value( uint16 index, uint8 offset) const uint16 GetUInt16Value( uint16 index, uint8 offset) const
{ {
ASSERT( index < m_valuesCount || PrintIndexError( index , false) ); ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
ASSERT( offset < 2 ); ASSERT( offset < 2 );

View file

@ -1794,7 +1794,7 @@ class MANGOS_DLL_SPEC Player : public Unit
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++) for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId) if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId)
return m_bgBattleGroundQueueID[i].invitedToInstance != 0; return m_bgBattleGroundQueueID[i].invitedToInstance != 0;
return PLAYER_MAX_BATTLEGROUND_QUEUES; return false;
} }
bool InBattleGroundQueueForBattleGroundQueueType(BattleGroundQueueTypeId bgQueueTypeId) const bool InBattleGroundQueueForBattleGroundQueueType(BattleGroundQueueTypeId bgQueueTypeId) const
{ {

View file

@ -1290,8 +1290,8 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
damageInfo->procEx|=PROC_EX_NORMAL_HIT; damageInfo->procEx|=PROC_EX_NORMAL_HIT;
float reducePercent = 1.0f; //damage factor float reducePercent = 1.0f; //damage factor
// calculate base values and mods // calculate base values and mods
float baseLowEnd = 1.3; float baseLowEnd = 1.3f;
float baseHighEnd = 1.2; float baseHighEnd = 1.2f;
switch(getClass()) // lowering base values for casters switch(getClass()) // lowering base values for casters
{ {
case CLASS_SHAMAN: case CLASS_SHAMAN:
@ -1299,17 +1299,17 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
case CLASS_MAGE: case CLASS_MAGE:
case CLASS_WARLOCK: case CLASS_WARLOCK:
case CLASS_DRUID: case CLASS_DRUID:
baseLowEnd -= 0.7; baseLowEnd -= 0.7f;
baseHighEnd -= 0.3; baseHighEnd -= 0.3f;
break; break;
} }
float maxLowEnd = 0.6; float maxLowEnd = 0.6f;
switch(getClass()) // upper for melee classes switch(getClass()) // upper for melee classes
{ {
case CLASS_WARRIOR: case CLASS_WARRIOR:
case CLASS_ROGUE: case CLASS_ROGUE:
maxLowEnd = 0.91; //If the attacker is a melee class then instead the lower value of 0.91 maxLowEnd = 0.91f; //If the attacker is a melee class then instead the lower value of 0.91
} }
// calculate values // calculate values
@ -1405,29 +1405,29 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
// Reduce attack time // Reduce attack time
if (pVictim->haveOffhandWeapon() && offtime < basetime) if (pVictim->haveOffhandWeapon() && offtime < basetime)
{ {
float percent20 = pVictim->GetAttackTime(OFF_ATTACK) * 0.20; float percent20 = pVictim->GetAttackTime(OFF_ATTACK) * 0.20f;
float percent60 = 3 * percent20; float percent60 = 3.0f * percent20;
if(offtime > percent20 && offtime <= percent60) if(offtime > percent20 && offtime <= percent60)
{ {
pVictim->setAttackTimer(OFF_ATTACK, uint32(percent20)); pVictim->setAttackTimer(OFF_ATTACK, uint32(percent20));
} }
else if(offtime > percent60) else if(offtime > percent60)
{ {
offtime -= 2 * percent20; offtime -= 2.0f * percent20;
pVictim->setAttackTimer(OFF_ATTACK, uint32(offtime)); pVictim->setAttackTimer(OFF_ATTACK, uint32(offtime));
} }
} }
else else
{ {
float percent20 = pVictim->GetAttackTime(BASE_ATTACK) * 0.20; float percent20 = pVictim->GetAttackTime(BASE_ATTACK) * 0.20;
float percent60 = 3 * percent20; float percent60 = 3.0f * percent20;
if(basetime > percent20 && basetime <= percent60) if(basetime > percent20 && basetime <= percent60)
{ {
pVictim->setAttackTimer(BASE_ATTACK, uint32(percent20)); pVictim->setAttackTimer(BASE_ATTACK, uint32(percent20));
} }
else if(basetime > percent60) else if(basetime > percent60)
{ {
basetime -= 2 * percent20; basetime -= 2.0f * percent20;
pVictim->setAttackTimer(BASE_ATTACK, uint32(basetime)); pVictim->setAttackTimer(BASE_ATTACK, uint32(basetime));
} }
} }
@ -1443,19 +1443,19 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
{ {
// -probability is between 0% and 40% // -probability is between 0% and 40%
// 20% base chance // 20% base chance
float Probability = 20; float Probability = 20.0f;
//there is a newbie protection, at level 10 just 7% base chance; assuming linear function //there is a newbie protection, at level 10 just 7% base chance; assuming linear function
if( pVictim->getLevel() < 30 ) if( pVictim->getLevel() < 30 )
Probability = 0.65f*pVictim->getLevel()+0.5; Probability = 0.65f*pVictim->getLevel()+0.5f;
uint32 VictimDefense=pVictim->GetDefenseSkillValue(); uint32 VictimDefense=pVictim->GetDefenseSkillValue();
uint32 AttackerMeleeSkill=GetUnitMeleeSkill(); uint32 AttackerMeleeSkill=GetUnitMeleeSkill();
Probability *= AttackerMeleeSkill/(float)VictimDefense; Probability *= AttackerMeleeSkill/(float)VictimDefense;
if(Probability > 40) if(Probability > 40.0f)
Probability = 40; Probability = 40.0f;
if(roll_chance_f(Probability)) if(roll_chance_f(Probability))
CastSpell(pVictim, 1604, true); CastSpell(pVictim, 1604, true);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7695" #define REVISION_NR "7696"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__