aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorSorikoff <46191832+Sorikoff@users.noreply.github.com>2019-03-03 18:54:07 +0000
committerShauren <shauren.trinity@gmail.com>2021-11-24 20:35:15 +0100
commita57ca5cea2d13bc5d5ddee11e7b8100c7afd68e1 (patch)
tree0a647d616c5888cdf92a7507ef67ed9e55f478fd /src/server/game/Entities
parentace33a464fa442d7d8dc331839d4e3efbaf63d57 (diff)
Core/Movement: Allow using run when moving randomly (#23081)
* Allow run when moving randomly (cherry picked from commit 34cfa69efd1857540f1f44b118086bb02334c100)
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp4
-rw-r--r--src/server/game/Entities/Creature/CreatureData.h14
2 files changed, 16 insertions, 2 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 3f66428e474..10f15315e4a 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -61,13 +61,15 @@ std::string CreatureMovementData::ToString() const
char const* const GroundStates[] = { "None", "Run", "Hover" };
char const* const FlightStates[] = { "None", "DisableGravity", "CanFly" };
char const* const ChaseStates[] = { "Run", "CanWalk", "AlwaysWalk" };
+ char const* const RandomStates[] = { "Walk", "CanRun", "AlwaysRun" };
std::ostringstream str;
str << std::boolalpha
<< "Ground: " << GroundStates[AsUnderlyingType(Ground)]
<< ", Swim: " << Swim
<< ", Flight: " << FlightStates[AsUnderlyingType(Flight)]
- << ", Chase: " << ChaseStates[AsUnderlyingType(Chase)];
+ << ", Chase: " << ChaseStates[AsUnderlyingType(Chase)]
+ << ", Random: " << RandomStates[AsUnderlyingType(Random)];
if (Rooted)
str << ", Rooted";
diff --git a/src/server/game/Entities/Creature/CreatureData.h b/src/server/game/Entities/Creature/CreatureData.h
index cfcfb6f1c23..572ccb62433 100644
--- a/src/server/game/Entities/Creature/CreatureData.h
+++ b/src/server/game/Entities/Creature/CreatureData.h
@@ -327,16 +327,27 @@ enum class CreatureChaseMovementType : uint8
Max
};
+enum class CreatureRandomMovementType : uint8
+{
+ Walk,
+ CanRun,
+ AlwaysRun,
+
+ Max
+};
+
struct TC_GAME_API CreatureMovementData
{
CreatureMovementData() : Ground(CreatureGroundMovementType::Run), Flight(CreatureFlightMovementType::None),
- Swim(true), Rooted(false), Chase(CreatureChaseMovementType::Run) { }
+ Swim(true), Rooted(false), Chase(CreatureChaseMovementType::Run),
+ Random(CreatureRandomMovementType::Walk) { }
CreatureGroundMovementType Ground;
CreatureFlightMovementType Flight;
bool Swim;
bool Rooted;
CreatureChaseMovementType Chase;
+ CreatureRandomMovementType Random;
bool IsGroundAllowed() const { return Ground != CreatureGroundMovementType::None; }
bool IsSwimAllowed() const { return Swim; }
@@ -344,6 +355,7 @@ struct TC_GAME_API CreatureMovementData
bool IsRooted() const { return Rooted; }
CreatureChaseMovementType GetChase() const { return Chase; }
+ CreatureRandomMovementType GetRandom() const { return Random; }
std::string ToString() const;
};