mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +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
|
|
@ -84,7 +84,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue