If creature is on transport, we assume waypoints set in DB are already transport offsets
Do not use formationDest here, MoveTo requires transport offsets due to DisableTransportPathTransformations() call but formationDest contains global coordinates
102{
104 return false;
105
106
108 return false;
109
111 return true;
112
114
116 {
117
118
119 {
124
125 if (!transportPath)
127 else
128 {
130 {
131 o -= trans->GetOrientation();
133 trans->CalculatePassengerPosition(x, y, z, &o);
135 }
136 else
137 transportPath = false;
138
139 }
140 }
141
142
144 {
147 return false;
148 }
149
151 }
152
153
155 {
156 return true;
157 }
158
160
162
164
167
169 if (transportPath)
170 {
171 init.DisableTransportPathTransformations();
173 trans->CalculatePassengerPosition(formationDest.x, formationDest.y, formationDest.z, &formationDest.orientation);
174 }
175
180 init.MoveTo(node->
x, node->
y, z,
true,
true);
181
184
186 {
189 break;
192 break;
194 init.SetWalk(false);
195 break;
197 init.SetWalk(true);
198 break;
199 default:
200 break;
201 }
202
203 init.Launch();
204
205
208
209 return true;
210}
@ MOVEMENTFLAG_ONTRANSPORT
Definition: UnitDefines.h:353
@ WAYPOINT_MOVE_TYPE_RUN
Definition: WaypointMgr.h:29
@ WAYPOINT_MOVE_TYPE_LAND
Definition: WaypointMgr.h:30
@ WAYPOINT_MOVE_TYPE_TAKEOFF
Definition: WaypointMgr.h:31
@ WAYPOINT_MOVE_TYPE_WALK
Definition: WaypointMgr.h:28
@ ToFly
Definition: MoveSplineInit.h:36
@ ToGround
Definition: MoveSplineInit.h:34
virtual void PathEndReached(uint32)
Definition: CreatureAI.h:160
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:336
CreatureGroup const * GetFormation() const
Definition: Creature.h:353
void SetTransportHomePosition(float x, float y, float z, float o)
Definition: Creature.h:341
Creature * GetLeader() const
Definition: CreatureGroups.h:99
void LeaderMoveTo(float x, float y, float z, uint32 move_type)
Definition: CreatureGroups.cpp:346
MotionTransport * ToMotionTransport()
Definition: GameObject.h:327
void UpdateAllowedPositionZ(float x, float y, float &z, float *groundZ=nullptr) const
Definition: Object.cpp:1565
Transport * GetTransport() const
Definition: Object.h:604
float GetOrientation() const
Definition: Position.h:119
Definition: Transport.h:29
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:736
TransportBase * GetDirectTransport() const
Definition: Unit.cpp:18767
ObjectGuid GetTransGUID() const override
Definition: Unit.cpp:18756
Definition: VehicleDefines.h:130
void Initialize()
Definition: MotionMaster.cpp:73
Definition: MoveSpline.h:27
Definition: MoveSplineInit.h:71
Definition: WaypointMgr.h:37
float z
Definition: WaypointMgr.h:39
float x
Definition: WaypointMgr.h:39
float y
Definition: WaypointMgr.h:39
std::optional< float > orientation
Definition: WaypointMgr.h:40
uint32 delay
Definition: WaypointMgr.h:41
uint32 move_type
Definition: WaypointMgr.h:43