[7527] Remove redundent arg from Player::EnvironmentalDamage

This commit is contained in:
VladimirMangos 2009-03-23 18:00:31 +03:00
parent fa098236af
commit 73ac0bcc7f
5 changed files with 15 additions and 15 deletions

View file

@ -292,7 +292,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
// TODO: discard movement packets after the player is rooted // TODO: discard movement packets after the player is rooted
if(GetPlayer()->isAlive()) if(GetPlayer()->isAlive())
{ {
GetPlayer()->EnvironmentalDamage(GetPlayer()->GetGUID(),DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth()); GetPlayer()->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth());
// change the death state to CORPSE to prevent the death timer from // change the death state to CORPSE to prevent the death timer from
// starting in the next player update // starting in the next player update
GetPlayer()->KillPlayer(); GetPlayer()->KillPlayer();

View file

@ -826,7 +826,7 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
GetSession()->SendPacket( &data ); GetSession()->SendPacket( &data );
} }
void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage) void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
{ {
if(!isAlive() || isGameMaster()) if(!isAlive() || isGameMaster())
return; return;
@ -842,11 +842,11 @@ void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 da
damage-=absorb+resist; damage-=absorb+resist;
WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21)); WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21));
data << (uint64)guid; data << uint64(GetGUID());
data << (uint8)(type!=DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL); data << uint8(type!=DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL);
data << (uint32)damage; data << uint32(damage);
data << (uint32)absorb; // absorb data << uint32(absorb);
data << (uint32)resist; // resist data << uint32(resist);
SendMessageToSet(&data, true); SendMessageToSet(&data, true);
DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@ -925,7 +925,7 @@ void Player::HandleDrowning(uint32 time_diff)
// Calculate and deal damage // Calculate and deal damage
// TODO: Check this formula // TODO: Check this formula
uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1); uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
EnvironmentalDamage(GetGUID(), DAMAGE_DROWNING, damage); EnvironmentalDamage(DAMAGE_DROWNING, damage);
} }
else if (!(m_MirrorTimerFlagsLast & UNDERWATER_INWATER)) // Update time in client if need else if (!(m_MirrorTimerFlagsLast & UNDERWATER_INWATER)) // Update time in client if need
SendMirrorTimer(BREATH_TIMER, getMaxTimer(BREATH_TIMER), m_MirrorTimer[BREATH_TIMER], -1); SendMirrorTimer(BREATH_TIMER, getMaxTimer(BREATH_TIMER), m_MirrorTimer[BREATH_TIMER], -1);
@ -961,7 +961,7 @@ void Player::HandleDrowning(uint32 time_diff)
if (isAlive()) // Calculate and deal damage if (isAlive()) // Calculate and deal damage
{ {
uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1); uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
EnvironmentalDamage(GetGUID(), DAMAGE_EXHAUSTED, damage); EnvironmentalDamage(DAMAGE_EXHAUSTED, damage);
} }
else if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard else if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard
RepopAtGraveyard(); RepopAtGraveyard();
@ -995,9 +995,9 @@ void Player::HandleDrowning(uint32 time_diff)
// TODO: Check this formula // TODO: Check this formula
uint32 damage = urand(600, 700); uint32 damage = urand(600, 700);
if (m_MirrorTimerFlags&UNDERWATER_INLAVA) if (m_MirrorTimerFlags&UNDERWATER_INLAVA)
EnvironmentalDamage(GetGUID(), DAMAGE_LAVA, damage); EnvironmentalDamage(DAMAGE_LAVA, damage);
else else
EnvironmentalDamage(GetGUID(), DAMAGE_SLIME, damage); EnvironmentalDamage(DAMAGE_SLIME, damage);
} }
} }
} }
@ -19933,7 +19933,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
if (GetDummyAura(43621)) if (GetDummyAura(43621))
damage = GetMaxHealth()/2; damage = GetMaxHealth()/2;
EnvironmentalDamage(GetGUID(), DAMAGE_FALL, damage); EnvironmentalDamage(DAMAGE_FALL, damage);
// recheck alive, might have died of EnvironmentalDamage // recheck alive, might have died of EnvironmentalDamage
if (isAlive()) if (isAlive())

View file

@ -1928,7 +1928,7 @@ class MANGOS_DLL_SPEC Player : public Unit
/*** ENVIROMENTAL SYSTEM ***/ /*** ENVIROMENTAL SYSTEM ***/
/*********************************************************/ /*********************************************************/
void EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage); void EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
/*********************************************************/ /*********************************************************/
/*** FLOOD FILTER SYSTEM ***/ /*** FLOOD FILTER SYSTEM ***/

View file

@ -297,7 +297,7 @@ void Spell::EffectEnvirinmentalDMG(uint32 i)
m_caster->SendSpellNonMeleeDamageLog(m_caster, m_spellInfo->Id, damage, GetSpellSchoolMask(m_spellInfo), absorb, resist, false, 0, false); m_caster->SendSpellNonMeleeDamageLog(m_caster, m_spellInfo->Id, damage, GetSpellSchoolMask(m_spellInfo), absorb, resist, false, 0, false);
if(m_caster->GetTypeId() == TYPEID_PLAYER) if(m_caster->GetTypeId() == TYPEID_PLAYER)
((Player*)m_caster)->EnvironmentalDamage(m_caster->GetGUID(),DAMAGE_FIRE,damage); ((Player*)m_caster)->EnvironmentalDamage(DAMAGE_FIRE,damage);
} }
void Spell::EffectSchoolDMG(uint32 effect_idx) void Spell::EffectSchoolDMG(uint32 effect_idx)

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 "7526" #define REVISION_NR "7527"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__