summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2015-05-06 08:38:31 +0200
committerAlexander Harkness <me@bearbin.net>2015-05-06 08:38:31 +0200
commitbd73dcedd4bdcfceb2a315f676e810ddcd6a3424 (patch)
tree7dd6bf3cb89b77e86e8b65d2d97b374f920b365f /src/Mobs/Monster.cpp
parentMerge pull request #1943 from mc-server/revert-1917-CodeCleanup (diff)
parentPF - Swimming bugfix (diff)
downloadcuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.gz
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.bz2
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.lz
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.xz
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.tar.zst
cuberite-bd73dcedd4bdcfceb2a315f676e810ddcd6a3424.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 7ced89e45..37774b08f 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -143,10 +143,11 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
{
/* If we reached the last path waypoint,
Or if we haven't re-calculated for too long.
- Interval is proportional to distance squared. (Recalculate lots when close, calculate rarely when far) */
+ Interval is proportional to distance squared, and its minimum is 10.
+ (Recalculate lots when close, calculate rarely when far) */
if (
((GetPosition() - m_PathFinderDestination).Length() < 0.25) ||
- m_TicksSinceLastPathReset > (0.15 * (m_FinalDestination - GetPosition()).SqrLength())
+ ((m_TicksSinceLastPathReset > 10) && (m_TicksSinceLastPathReset > (0.15 * (m_FinalDestination - GetPosition()).SqrLength())))
)
{
ResetPathFinding();