From cada4a5ac4172abecd8b09cd98236325c36ecf4c Mon Sep 17 00:00:00 2001 From: obligaron Date: Sat, 26 Jun 2021 12:05:08 +0200 Subject: [PATCH] Introduce MonsterStruct.IsWalking() --- Source/monster.cpp | 12 ++++++++++++ Source/monster.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/Source/monster.cpp b/Source/monster.cpp index 1966ddee2..07419016d 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -5420,4 +5420,16 @@ void MonsterStruct::Petrify() AnimInfo.IsPetrified = true; } +bool MonsterStruct::IsWalking() const +{ + switch (_mmode) { + case MM_WALK: + case MM_WALK2: + case MM_WALK3: + return true; + default: + return false; + } +} + } // namespace devilution diff --git a/Source/monster.h b/Source/monster.h index ce706b706..cdfb9545c 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -201,6 +201,11 @@ struct MonsterStruct { // note: missing field _mAFNum * @brief Sets _mmode to MM_STONE */ void Petrify(); + + /** + * @brief Is the monster currently walking? + */ + bool IsWalking() const; }; extern int monstkills[MAXMONSTERS];