diff options
| author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-01-07 12:35:04 +0100 |
|---|---|---|
| committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-01-07 12:35:04 +0100 |
| commit | cca4254f7c502b3e75691c6a3087da7cfcd72e28 (patch) | |
| tree | e71b47442e77e09ca17e2c9c121a455f9deeace2 /src/client/content_cao.cpp | |
| parent | 4fedc3a31ee20813e4c81377b3bd2af05a26b858 (diff) | |
| parent | 58a709096ef8ff17644cf201f25b1831d9506514 (diff) | |
| download | dragonfireclient-cca4254f7c502b3e75691c6a3087da7cfcd72e28.tar.xz | |
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/client/content_cao.cpp')
| -rw-r--r-- | src/client/content_cao.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index a5db49cd2..c44c167b5 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -1173,7 +1173,7 @@ void GenericCAO::step(float dtime, ClientEnvironment *env) } } - if (!getParent() && std::fabs(m_prop.automatic_rotate) > 0.001) { + if (!getParent() && node && fabs(m_prop.automatic_rotate) > 0.001f) { // This is the child node's rotation. It is only used for automatic_rotate. v3f local_rot = node->getRotation(); local_rot.Y = modulo360f(local_rot.Y - dtime * core::RADTODEG * @@ -1182,7 +1182,7 @@ void GenericCAO::step(float dtime, ClientEnvironment *env) } if (!getParent() && m_prop.automatic_face_movement_dir && - (fabs(m_velocity.Z) > 0.001 || fabs(m_velocity.X) > 0.001)) { + (fabs(m_velocity.Z) > 0.001f || fabs(m_velocity.X) > 0.001f)) { float target_yaw = atan2(m_velocity.Z, m_velocity.X) * 180 / M_PI + m_prop.automatic_face_movement_dir_offset; float max_rotation_per_sec = |
