The-Cataclysm-Preservation-Project / TrinityCore

Archived repository for WoW 4.3.4.15595. The project will be reworked for Cataclysm Classic as an official new branch of TrinityCore at https://github.com/TrinityCore/TrinityCore
GNU General Public License v2.0
237 stars 97 forks source link

Core/Spells: if for TARGET_UNIT_MASTER owner aquire fails, try to retrieve owner by using TempSummon #421

Closed sanctum32 closed 1 year ago

sanctum32 commented 1 year ago

Changes proposed:

This PR allows to gather owner for TARGET_UNIT_MASTER by using TempSummon if by some case function "GetCharmerOrOwner()" fails to retrieve owner

Issues addressed: Fixes #

Tests performed: (Does it build, tested in-game, etc)

Known issues and TODO list:

Ovahlord commented 1 year ago

This PR is conflicting with the upcoming tempsummon rework.

Furthermore GetOwner() is only meant to return the unit that is specified in UNIT_FIELD_SUMMONEDBY which is set for summons listed unter SummonPropertiesControl::Pet.

TARGET_UNIT_MASTER is only meant to work with charmed units and controlled pets, so the spell should actually target GetCharmerOrOwner(). If that one fails that getter needs to be investigated