TrinityCore / TrinityCore/TrinityCore

Core/Spells: Unintended orientation overriding for SPELL_EFFECT_TELEPORT_UNITS?

Open
#28,022 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Branch-master
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
  1. Use horde character
  2. Add quest 34398
  3. Talk to npc entry 149626
  4. Select first gossip option
  5. notice orientation isn't 0 after teleport
Branch

master

TC rev. hash/commit

8f537b96868647d73aacd576bbe90bda138dd589

Operating system

Win10

Custom changes

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.