[7527] Remove redundent arg from Player::EnvironmentalDamage Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
+16
-12
@@ -885,7 +885,7 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
|
||||
GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
||||
void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage)
|
||||
void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
||||
{
|
||||
if(!isAlive() || isGameMaster())
|
||||
return;
|
||||
@@ -901,11 +901,11 @@ void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 da
|
||||
damage-=absorb+resist;
|
||||
|
||||
WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21));
|
||||
data << (uint64)guid;
|
||||
data << (uint8)(type!=DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL);
|
||||
data << (uint32)damage;
|
||||
data << (uint32)absorb; // absorb
|
||||
data << (uint32)resist; // resist
|
||||
data << uint64(GetGUID());
|
||||
data << uint8(type!=DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL);
|
||||
data << uint32(damage);
|
||||
data << uint32(absorb);
|
||||
data << uint32(resist);
|
||||
SendMessageToSet(&data, true);
|
||||
|
||||
DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
@@ -984,7 +984,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
// Calculate and deal damage
|
||||
// TODO: Check this formula
|
||||
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
|
||||
SendMirrorTimer(BREATH_TIMER, getMaxTimer(BREATH_TIMER), m_MirrorTimer[BREATH_TIMER], -1);
|
||||
@@ -1020,7 +1020,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
if (isAlive()) // Calculate and deal damage
|
||||
{
|
||||
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
|
||||
RepopAtGraveyard();
|
||||
@@ -1054,9 +1054,9 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
// TODO: Check this formula
|
||||
uint32 damage = urand(600, 700);
|
||||
if (m_MirrorTimerFlags&UNDERWATER_INLAVA)
|
||||
EnvironmentalDamage(GetGUID(), DAMAGE_LAVA, damage);
|
||||
EnvironmentalDamage(DAMAGE_LAVA, damage);
|
||||
else
|
||||
EnvironmentalDamage(GetGUID(), DAMAGE_SLIME, damage);
|
||||
EnvironmentalDamage(DAMAGE_SLIME, damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14530,7 +14530,11 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||
//Need to call it to initialize m_team (m_team can be calculated from m_race)
|
||||
//Other way is to saves m_team into characters table.
|
||||
setFactionForRace(m_race);
|
||||
<<<<<<< HEAD:src/game/Player.cpp
|
||||
SetMover(this);
|
||||
=======
|
||||
SetCharm(NULL);
|
||||
>>>>>>> ef97c26c0d232525c291f647f3384f9bcfc3ea4b:src/game/Player.cpp
|
||||
|
||||
m_class = fields[5].GetUInt8();
|
||||
|
||||
@@ -20060,7 +20064,7 @@ void Player::HandleFallUnderMap()
|
||||
// TODO: discard movement packets after the player is rooted
|
||||
if(isAlive())
|
||||
{
|
||||
EnvironmentalDamage(GetGUID(),DAMAGE_FALL_TO_VOID, GetMaxHealth());
|
||||
EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetMaxHealth());
|
||||
// change the death state to CORPSE to prevent the death timer from
|
||||
// starting in the next player update
|
||||
KillPlayer();
|
||||
@@ -20667,7 +20671,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
if (GetDummyAura(43621))
|
||||
damage = GetMaxHealth()/2;
|
||||
|
||||
EnvironmentalDamage(GetGUID(), DAMAGE_FALL, damage);
|
||||
EnvironmentalDamage(DAMAGE_FALL, damage);
|
||||
|
||||
// recheck alive, might have died of EnvironmentalDamage
|
||||
if (isAlive())
|
||||
|
||||
Reference in New Issue
Block a user