TrinityCore / TrinityCore/TrinityCore
Core/Spells: Unintended orientation overriding for SPELL_EFFECT_TELEPORT_UNITS?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.8k
- Forks
- 6.4k
- Avg merge
- 3d 16m
- Merged PRs (30d)
- 6
Description
Description
While reviewing #27980 i noticed that spellid 171229 should be using orientation 0 for the teleport, but its overridden by player orientation in the core here: https://github.com/TrinityCore/TrinityCore/blob/8f537b96868647d73aacd576bbe90bda138dd589/src/server/game/Spells/SpellEffects.cpp#L902-L903
So the question is if there are any additional conditions required to override db2 orientation with target orientation or if the code is just outdated.
Related sniff data
ServerToClient: SMSG_SPELL_GO (0x2C39) Length: 144 ConnIdx: 1 Time: 06/11/2022 14:46:21.434 Number: 4986
(Cast) CasterGUID: Full:-snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) CasterUnit: Full: -snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) CastID: Full: -snip- Cast/3 R4235/S10998 Map: 1 (Kalimdor) Low: -snip-
(Cast) OriginalCastID: Full: 0x0
(Cast) SpellID: 171229 (Portal Effect: Shattered Landing, Horde)
(Cast) (Visual) SpellXSpellVisualID: 0
(Cast) (Visual) ScriptVisualID: 0
(Cast) CastFlags: 781
(Cast) CastFlagsEx: 16
(Cast) CastTime: 1389173573
(Cast) (MissileTrajectory) TravelTime: 0
(Cast) (MissileTrajectory) Pitch: 0
(Cast) Ammo.DisplayID: 0
(Cast) DestLocSpellCastIndex: 2
(Cast) (Immunities) School: 0
(Cast) (Immunities) Value: 0
(Cast) (Predict) Points: 0
(Cast) (Predict) Type: 0
(Cast) (Predict) BeaconGUID: Full: 0x0
(Cast) HitTargetsCount: 1
(Cast) MissTargetsCount: 0
(Cast) HitStatusCount: 1
(Cast) MissStatusCount: 0
(Cast) RemainingPowerCount: 0
(Cast) HasRuneData: False
(Cast) TargetPointsCount: 0
(Cast) (Target) Flags: 66 (Unit, DestinationLocation)
(Cast) (Target) HasSrcLocation: False
(Cast) (Target) HasDstLocation: True
(Cast) (Target) HasOrientation: True
(Cast) (Target) hasMapID : True
(Cast) (Target) Unit: Full: -snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) (Target) Item: Full: 0x0
(DstLocation) Transport: Full: 0x0
(DstLocation) Location: X: -11788.7 Y: -3855.65 Z: 60.03
(Cast) (Target) Orientation: 0
(Cast) (Target) MapID: 0
(Cast) (Target) Name:
(Cast) [0] HitTarget: Full: -snip- Player/0 R1408/S0 Map: 0 (Eastern Kingdoms) Low: -snip-
(Cast) [0] HitStatus: 0
ServerToClient: SMSG_NEW_WORLD (0x2598) Length: 44 ConnIdx: 1 Time: 06/11/2022 14:46:22.469 Number: 5084
Map: 0 (Eastern Kingdoms)
Position: X: -11788.7 Y: -3855.65 Z: 60.03 O: 0
Unused901_1: -1
Unused901_2: -1
Reason: 6
MovementOffset: X: 0 Y: 0 Z: 0
Expected behaviour
Orientation should not be overridden
Steps to reproduce the problem
- Use horde character
- Add quest 34398
- Talk to npc entry 149626
- Select first gossip option
- notice orientation isn't 0 after teleport
Branch
master
TC rev. hash/commit
8f537b96868647d73aacd576bbe90bda138dd589
Operating system
Win10
Custom changes
None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/server/game/Spells/SpellEffects.cpp at the linked lines and trace the orientation handling for spell 171229. Reproduce it with quest 34398, NPC 149626, and the first gossip option using a Horde character. Done means the teleport preserves orientation 0 rather than overriding it with the player's orientation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100