diff options
author | Treeston <treeston.mmoc@gmail.com> | 2018-04-06 18:09:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-06 18:09:55 +0200 |
commit | 2a84562dc85516f432bb1e5de9add23c28b26ce4 (patch) | |
tree | 2b7414c164370c5144586beb76946db41061fad7 /src/common/Utilities/Util.h | |
parent | 9f03743d2d803cba553b2f95a87b106bf5e3f672 (diff) |
Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.
Diffstat (limited to 'src/common/Utilities/Util.h')
-rw-r--r-- | src/common/Utilities/Util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 1240ce4205f..195aa22ca22 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -89,6 +89,9 @@ inline T RoundToInterval(T& num, T floor, T ceil) return num = std::min(std::max(num, floor), ceil); } +template <class T> +inline T square(T x) { return x*x; } + // UTF8 handling TC_COMMON_API bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr); |