mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +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:
@@ -86,7 +86,7 @@ ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint3
|
||||
if(factionTemplate)
|
||||
{
|
||||
FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction);
|
||||
if( faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY)
|
||||
if( faction && faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user