Skip to content

Commit

Permalink
[12160] Allow SplineMovement flags for vehicles
Browse files Browse the repository at this point in the history
First author to use the spline movement in vehicle patches unknown, likely names are zergtmn or rsa

Signed-off-by: Schmoozerd <schmoozerd@cmangos>

Conflicts:

	src/game/movement/MoveSplineFlag.h
	src/shared/revision_nr.h
  • Loading branch information
kid10 authored and rsa committed Sep 14, 2012
1 parent 19a35b2 commit bc30eae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/game/MotionMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ void MotionMaster::MoveSkyDiving(float x, float y, float z, float o, float horiz
init.SetVelocity(horizontalSpeed);
init.SetFacing(o);
if (!eject)
init.SetTransportExit();
init.SetExitVehicle();
init.Launch();
Mutate(new EjectMovementGenerator(0), UNIT_ACTION_EFFECT);
}
Expand Down
23 changes: 11 additions & 12 deletions src/game/movement/MoveSplineFlag.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ namespace Movement
Enter_Cycle = 0x00100000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done
Animation = 0x00200000, // Plays animation after some time passed
Frozen = 0x00400000, // Will never arrive
Transport = 0x00800000,
TransportExit = 0x01000000,
BoardVehicle = 0x00800000,
ExitVehicle = 0x01000000,
Unknown7 = 0x02000000,
Unknown8 = 0x04000000,
OrientationInversed = 0x08000000,
Expand Down Expand Up @@ -102,14 +102,13 @@ namespace Movement
void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | anim;}
void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation)) | Parabolic;}
void EnableFalling() { raw() = (raw() & ~(Mask_Animations | Parabolic | Animation)) | Falling;}
void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; }
void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; }
void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;}
void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;}
void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;}

void EnableTransport() { raw() = (raw() & ~TransportExit) | Transport; }
void EnableTransportExit() { raw() = (raw() & ~Transport) | TransportExit; }
void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; }
void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; }
void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;}
void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;}
void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;}
void EnableBoardVehicle() { raw() = (raw() & ~(Catmullrom | ExitVehicle)) | BoardVehicle; }
void EnableExitVehicle() { raw() = (raw() & ~BoardVehicle) | ExitVehicle; }

uint8 animId : 8;
bool done : 1;
Expand All @@ -127,8 +126,8 @@ namespace Movement
bool enter_cycle : 1;
bool animation : 1;
bool frozen : 1;
bool transport : 1;
bool transportExit : 1;
bool boardVehicle : 1;
bool exitVehicle : 1;
bool unknown7 : 1;
bool unknown8 : 1;
bool orientationInversed : 1;
Expand Down
20 changes: 10 additions & 10 deletions src/game/movement/MoveSplineInit.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ namespace Movement
*/
void SetVelocity(float velocity);

/* Sets BoardVehicle flag
*/
void SetBoardVehicle();

/* Sets ExitVehicle flag
*/
void SetExitVehicle();

PointsArray& Path() { return args.path; }

protected:
Expand All @@ -133,6 +141,8 @@ namespace Movement
inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel;}
inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;}
inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable;}
inline void MoveSplineInit::SetBoardVehicle() { args.flags.EnableBoardVehicle(); }
inline void MoveSplineInit::SetExitVehicle() { args.flags.EnableExitVehicle(); }

inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset)
{
Expand Down Expand Up @@ -182,15 +192,5 @@ namespace Movement
args.facing.f.z = spot.z;
args.flags.EnableFacingPoint();
}

inline void MoveSplineInit::SetTransportEnter()
{
args.flags.EnableTransport();
}

inline void MoveSplineInit::SetTransportExit()
{
args.flags.EnableTransportExit();
}
}
#endif // MANGOSSERVER_MOVESPLINEINIT_H
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12154"
#define REVISION_NR "12160"
#endif // __REVISION_NR_H__

0 comments on commit bc30eae

Please sign in to comment.