mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
factionTemplate->faction can be 0, add appropriate checks to prevent crashes and unexpected work. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -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