mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
factionTemplate->faction can be 0, add appropriate checks to prevent crashes and unexpected work.
This commit is contained in:
parent
3ab8264189
commit
03273a49da
4 changed files with 73 additions and 44 deletions
|
|
@ -5652,7 +5652,8 @@ void Player::SetFactionVisibleForFactionTemplateId(uint32 FactionTemplateId)
|
|||
if(!factionTemplateEntry)
|
||||
return;
|
||||
|
||||
SetFactionVisibleForFactionId(factionTemplateEntry->faction);
|
||||
if(factionTemplateEntry->faction)
|
||||
SetFactionVisibleForFactionId(factionTemplateEntry->faction);
|
||||
}
|
||||
|
||||
void Player::SetFactionVisibleForFactionId(uint32 FactionId)
|
||||
|
|
@ -18687,7 +18688,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue