factionTemplate->faction can be 0, add appropriate checks to prevent crashes and unexpected work. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
1 parent
0a78760b75
commit
c113bf884f
4 files changed
+73
-44
No files matched your search
+3
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user