diff options
| author | megamage <none@none> | 2009-03-03 16:18:22 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-03-03 16:18:22 -0600 |
| commit | c113bf884f9523745f22aae78cde80903b2ba192 (patch) | |
| tree | a14135ce66c9b514a318c9f90a89034c3a1eade4 /src/game/Player.cpp | |
| parent | 0a78760b758235ba2c48fc6b48514403ed052730 (diff) | |
factionTemplate->faction can be 0, add appropriate checks to prevent crashes and unexpected work. Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5d0f4c4e598..ac261b90529 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5757,7 +5757,8 @@ void Player::SetFactionVisibleForFactionTemplateId(uint32 FactionTemplateId) if(!factionTemplateEntry) return; - SetFactionVisibleForFactionId(factionTemplateEntry->faction); + if(factionTemplateEntry->faction) + SetFactionVisibleForFactionId(factionTemplateEntry->faction); } void Player::SetFactionVisibleForFactionId(uint32 FactionId) @@ -19247,7 +19248,7 @@ BGQueueIdBasedOnLevel Player::GetBattleGroundQueueIdFromLevel(BattleGroundTypeId float Player::GetReputationPriceDiscount( Creature const* pCreature ) const { FactionTemplateEntry const* vendor_faction = pCreature->getFactionTemplateEntry(); - if(!vendor_faction) + if(!vendor_faction || !vendor_faction->faction) return 1.0f; ReputationRank rank = GetReputationRank(vendor_faction->faction); |
