From 305f96f3c5eee9cbbec512414a7bca66497db486 Mon Sep 17 00:00:00 2001 From: billy1arm Date: Thu, 22 Aug 2024 08:57:44 +0100 Subject: [PATCH] Fix some style issues --- src/game/BattleGround/BattleGround.cpp | 2 + src/game/Object/CreatureAI.h | 1 + src/game/movement/MoveSplineInit.h | 70 ++++++++++++++++++++++++-- 3 files changed, 69 insertions(+), 4 deletions(-) diff --git a/src/game/BattleGround/BattleGround.cpp b/src/game/BattleGround/BattleGround.cpp index a06a588bc..a0029863a 100644 --- a/src/game/BattleGround/BattleGround.cpp +++ b/src/game/BattleGround/BattleGround.cpp @@ -208,10 +208,12 @@ template 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() diff --git a/src/game/Object/CreatureAI.h b/src/game/Object/CreatureAI.h index 6379c739a..c2e5d166e 100644 --- a/src/game/Object/CreatureAI.h +++ b/src/game/Object/CreatureAI.h @@ -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: diff --git a/src/game/movement/MoveSplineInit.h b/src/game/movement/MoveSplineInit.h index 175606e39..5754f9ad0 100644 --- a/src/game/movement/MoveSplineInit.h +++ b/src/game/movement/MoveSplineInit.h @@ -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); /** @@ -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 * @@ -177,6 +188,11 @@ namespace Movement */ void SetExitVehicle(); + /** + * @brief + * + * @return PointsArray + */ PointsArray& Path() { return args.path; } protected: @@ -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) @@ -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;