Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix search for TARGET_SCRIPT if searcher DYN/GAMEOBJ
bug after 6cd4c2b commit. when caster (player) and GO have different phase mask, we don't find targets. example: Q24507 GO 201969 (Ball and chain) have phase mask 1 NPC 36770... (Horde Slave) have phase mask 64 player have phase mask 65 so player see GO and NPC, but if search target from GO we don't find NPC.
- Loading branch information
e928ef6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a workaround 😄
Changing phases just to make the grid searcher happy is ugly. We should actually update the grid searcher to be able to pick up GOs or creatures from different phases.
Also we should mention this in the comments, so that we are aware of it for the future
e928ef6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok =)
maybe
CreatureLastSearcher(Creature*& result, Check& check, ___uint32 overridePhaseMask = 0___) : i_phaseMask(___overridePhaseMask ? overridePhaseMask : check.GetFocusObject().GetPhaseMask()___), i_object(result), i_check(check) {}
?
or add param searcherForPhaseMask to
NearestCreatureEntryWithLiveStateInObjectRangeCheck
e928ef6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current hack look very ugly (( search code don't must touch object states
e928ef6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding caster phasemask param look like clean solution
e928ef6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in next commit