Skip to content

Commit

Permalink
Fix some style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1arm committed Aug 22, 2024
1 parent 4c31e76 commit 305f96f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/game/BattleGround/BattleGround.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,12 @@ template<class Do>
void BattleGround::BroadcastWorker(Do& _do)
{
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
if (Player* plr = sObjectAccessor.FindPlayer(itr->first))
{
_do(plr);
}
}
}

BattleGround::BattleGround()
Expand Down
1 change: 1 addition & 0 deletions src/game/Object/CreatureAI.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ class CreatureAI
*/
virtual void ReceiveAIEvent(AIEventType /*eventType*/, Creature* /*pSender*/, Unit* /*pInvoker*/, uint32 /*miscValue*/) {}

// Reset should be defined here, as it is called from out the AI ctor now
virtual void Reset() {}

protected:
Expand Down
70 changes: 66 additions & 4 deletions src/game/movement/MoveSplineInit.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ namespace Movement
* @param maxPathRange
*/
void MoveTo(const Vector3& destination, bool generatePath = false, bool forceDestination = false);
/**
* @brief
*
* @param x
* @param y
* @param z
* @param generatePath
* @param forceDestination
*/
void MoveTo(float x, float y, float z, bool generatePath = false, bool forceDestination = false);

/**
Expand Down Expand Up @@ -161,7 +170,9 @@ namespace Movement
*/
void SetOrientationFixed(bool enable);

/* Sets the velocity (in case you want to have custom movement velocity)
/**
* @brief Sets the velocity (in case you want to have custom movement velocity)
*
* if no set, speed will be selected based on unit's speeds and current movement mode
* Has no effect if falling mode enabled
*
Expand All @@ -177,6 +188,11 @@ namespace Movement
*/
void SetExitVehicle();

/**
* @brief
*
* @return PointsArray
*/
PointsArray& Path() { return args.path; }

protected:
Expand All @@ -185,32 +201,73 @@ namespace Movement
Unit& unit; /**< TODO */
};

/**
* @brief
*
*/
inline void MoveSplineInit::SetFly() { args.flags.EnableFlying();}

/**
* @brief
*
* @param enable
*/
inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable;}
inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();}
/**
* @brief
*
*/
inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;}

/**
* @brief
*
*/
inline void MoveSplineInit::SetFall() { args.flags.EnableFalling();}

/**
* @brief
*
* @param vel
*/
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(); }

/**
* @brief
*
* @param controls
* @param path_offset
*/
inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset)
{
args.path_Idx_offset = path_offset;
args.path.assign(controls.begin(), controls.end());
}

/**
* @brief
*
* @param x
* @param y
* @param z
* @param generatePath
* @param forceDestination
*/
inline void MoveSplineInit::MoveTo(float x, float y, float z, bool generatePath, bool forceDestination)
{
Vector3 v(x, y, z);
MoveTo(v, generatePath, forceDestination);
}

/**
* @brief
*
* @param dest
* @param generatePath
* @param forceDestination
*/
inline void MoveSplineInit::MoveTo(const Vector3& dest, bool generatePath, bool forceDestination)
{
if (generatePath)
Expand Down Expand Up @@ -240,6 +297,11 @@ namespace Movement
args.flags.EnableAnimation((uint8)anim);
}

/**
* @brief
*
* @param spot
*/
inline void MoveSplineInit::SetFacing(Vector3 const& spot)
{
args.facing.f.x = spot.x;
Expand Down

0 comments on commit 305f96f

Please sign in to comment.