aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-09-02 16:24:41 -0500
committermegamage <none@none>2009-09-02 16:24:41 -0500
commitca514fde8086fe9bfb946a2ab3bb804423809639 (patch)
tree4365c112d3d3f4455c3de930841efcee5f901e91 /src
parent790c5348a33ad28422e9356e598bf7084b0159b6 (diff)
[8446] Update ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING only for real alive cases. Author: Opterman
This fix problem with temporary "alive" cases for prist talent for example. Signed-off-by: VladimirMangos <vladimir@getmangos.com> * Use final damage for check * Also fix CMSG_REPOP_REQUEST read warning spam. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/MiscHandler.cpp4
-rw-r--r--src/game/Player.cpp15
-rw-r--r--src/game/Player.h2
3 files changed, 13 insertions, 8 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
index 0268aa4ddf6..1d5fb4951d5 100644
--- a/src/game/MiscHandler.cpp
+++ b/src/game/MiscHandler.cpp
@@ -48,10 +48,12 @@
#include "Vehicle.h"
#include "CreatureAI.h"
-void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
+void WorldSession::HandleRepopRequestOpcode( WorldPacket & recv_data )
{
sLog.outDebug( "WORLD: Recvd CMSG_REPOP_REQUEST Message" );
+ recv_data.read_skip<uint8>();
+
if(GetPlayer()->isAlive()||GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
return;
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index c69d9128106..73a5ee7c142 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -874,10 +874,10 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
GetSession()->SendPacket( &data );
}
-void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
+uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
{
if(!isAlive() || isGameMaster())
- return;
+ return 0;
// Absorb, resist some environmental damage type
uint32 absorb = 0;
@@ -899,7 +899,7 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
data << uint32(resist);
SendMessageToSet(&data, true);
- DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ uint32 final_damage = DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
if(!isAlive())
{
@@ -914,6 +914,8 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
}
+
+ return final_damage;
}
int32 Player::getMaxTimer(MirrorTimerType timer)
@@ -21129,10 +21131,11 @@ void Player::HandleFall(MovementInfo const& movementInfo)
if (HasAura(43621))
damage = GetMaxHealth()/2;
- EnvironmentalDamage(DAMAGE_FALL, damage);
+ uint32 original_health = GetHealth();
+ uint32 final_damage = EnvironmentalDamage(DAMAGE_FALL, damage);
- // recheck alive, might have died of EnvironmentalDamage
- if (damage < GetHealth())
+ // recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case
+ if (isAlive() && final_damage < original_health)
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
}
diff --git a/src/game/Player.h b/src/game/Player.h
index 9a3821cc3e8..75b6e25c1c3 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2038,7 +2038,7 @@ class MANGOS_DLL_SPEC Player : public Unit
/*** ENVIROMENTAL SYSTEM ***/
/*********************************************************/
- void EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
+ uint32 EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
/*********************************************************/
/*** FLOOD FILTER SYSTEM ***/