More warning fixes

This commit is contained in:
Shauren
2011-03-08 19:11:02 +01:00
parent cbbfb52ca7
commit 9710c41a40
19 changed files with 119 additions and 96 deletions
+2 -2
View File
@@ -2753,10 +2753,10 @@ void Player::GiveLevel(uint8 level)
sScriptMgr->OnPlayerLevelChanged(this, level);
PlayerLevelInfo info;
sObjectMgr->GetPlayerLevelInfo(getRace(),getClass(),level,&info);
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info);
PlayerClassLevelInfo classInfo;
sObjectMgr->GetPlayerClassLevelInfo(getClass(),level,&classInfo);
sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo);
// send levelup info to client
WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_POWERS*4+MAX_STATS*4));
+7 -6
View File
@@ -2732,10 +2732,11 @@ void AddItemsSetItem(Player*player,Item *item);
void RemoveItemsSetItem(Player*player,ItemPrototype const *proto);
// "the bodies of template functions must be made available in a header file"
template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell * spell)
template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo) return 0;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo)
return 0;
float totalmul = 1.0f;
int32 totalflat = 0;
@@ -2751,7 +2752,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
if (!mod->ownerAura)
ASSERT(mod->charges == 0);
if (!IsAffectedBySpellmod(spellInfo,mod,spell))
if (!IsAffectedBySpellmod(spellInfo, mod, spell))
continue;
if (mod->type == SPELLMOD_FLAT)
@@ -2762,8 +2763,8 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
if (basevalue == T(0))
continue;
// special case (skip >10sec spell casts for instant cast setting)
if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
// special case (skip > 10sec spell casts for instant cast setting)
if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
continue;
AddPctN(totalmul, mod->value);
+28 -28
View File
@@ -16178,7 +16178,7 @@ uint32 Unit::GetCombatRatingDamageReduction(CombatRating cr, float rate, float c
uint32 Unit::GetModelForForm(ShapeshiftForm form)
{
switch(form)
switch (form)
{
case FORM_CAT:
// Based on Hair color
@@ -16347,39 +16347,39 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form)
return 21243;
return 21244;
default:
{
uint32 modelid = 0;
SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form);
if (formEntry && formEntry->modelID_A)
{
// Take the alliance modelid as default
if (GetTypeId() != TYPEID_PLAYER)
return formEntry->modelID_A;
else
{
if (Player::TeamForRace(getRace()) == ALLIANCE)
modelid = formEntry->modelID_A;
else
modelid = formEntry->modelID_H;
break;
}
// If the player is horde but there are no values for the horde modelid - take the alliance modelid
if (!modelid && Player::TeamForRace(getRace()) == HORDE)
modelid = formEntry->modelID_A;
}
}
return modelid;
uint32 modelid = 0;
SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form);
if (formEntry && formEntry->modelID_A)
{
// Take the alliance modelid as default
if (GetTypeId() != TYPEID_PLAYER)
return formEntry->modelID_A;
else
{
if (Player::TeamForRace(getRace()) == ALLIANCE)
modelid = formEntry->modelID_A;
else
modelid = formEntry->modelID_H;
// If the player is horde but there are no values for the horde modelid - take the alliance modelid
if (!modelid && Player::TeamForRace(getRace()) == HORDE)
modelid = formEntry->modelID_A;
}
}
return 0;
return modelid;
}
uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
{
switch(getRace())
switch (getRace())
{
case RACE_ORC:
{
switch(totemType)
switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 30758;
@@ -16394,7 +16394,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_DWARF:
{
switch(totemType)
switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 30754;
@@ -16409,7 +16409,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_TROLL:
{
switch(totemType)
switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 30762;
@@ -16424,7 +16424,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_TAUREN:
{
switch(totemType)
switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 4589;
@@ -16439,7 +16439,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
case RACE_DRAENEI:
{
switch(totemType)
switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: //fire
return 19074;