diff options
| author | treeston <treeston.mmoc@gmail.com> | 2016-02-03 11:15:09 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-04-02 17:49:38 +0200 |
| commit | 02c9a66b88962c4c395b18411815ad41f5bffa6c (patch) | |
| tree | 011f1c19f1d39fdbd4d37b9a694076a31a654981 /src | |
| parent | a51ec98044c9251d28aade205ae5e300ab61d955 (diff) | |
fix crash
(cherry picked from commit bf31f26e8c467536456f5ce896274c9c20766eaf)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Miscellaneous/Formulas.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 9d1e237ff74..94aa48168da 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -181,7 +181,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); |
