aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-02-03 11:15:09 +0100
committertreeston <treeston.mmoc@gmail.com>2016-02-03 11:15:09 +0100
commitbf31f26e8c467536456f5ce896274c9c20766eaf (patch)
tree47039de2ea3bd5b2c09253d535dda739a96d2cda
parentd5868a7db31a13ac147a66a25cb4c3a6b8a93f8a (diff)
fix crash
-rw-r--r--src/server/game/Miscellaneous/Formulas.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h
index 6f987b8adb3..b5c6f37b14e 100644
--- a/src/server/game/Miscellaneous/Formulas.h
+++ b/src/server/game/Miscellaneous/Formulas.h
@@ -185,7 +185,7 @@ namespace Trinity
}
xpMod *= isBattleGround ? sWorld->getRate(RATE_XP_BG_KILL) : sWorld->getRate(RATE_XP_KILL);
- if (creature->m_PlayerDamageReq) // if players dealt less than 50% of the damage and were credited anyway (due to CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ), scale XP gained appropriately (linear scaling)
+ if (creature && creature->m_PlayerDamageReq) // if players dealt less than 50% of the damage and were credited anyway (due to CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ), scale XP gained appropriately (linear scaling)
xpMod *= 1.0f - 2.0f*creature->m_PlayerDamageReq / creature->GetMaxHealth();
gain = uint32(gain * xpMod);