summaryrefslogtreecommitdiff
path: root/src/client/content_cao.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-12-23 22:03:49 +0100
committersfan5 <sfan5@live.de>2020-12-24 13:44:54 +0100
commit74762470b2aa11a5271b846549ff14b86c1705d2 (patch)
treecf4fd29ba05a94395674ac6cd5b2eeb7bdac0ee1 /src/client/content_cao.cpp
parent289425f6bd6cfe1f66218918d9d5bd1b9f89aa7c (diff)
downloadminetest-74762470b2aa11a5271b846549ff14b86c1705d2.tar.gz
minetest-74762470b2aa11a5271b846549ff14b86c1705d2.tar.bz2
minetest-74762470b2aa11a5271b846549ff14b86c1705d2.zip
Fix some minor code issues all over the place
Diffstat (limited to 'src/client/content_cao.cpp')
-rw-r--r--src/client/content_cao.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp
index c645900aa..c65977b44 100644
--- a/src/client/content_cao.cpp
+++ b/src/client/content_cao.cpp
@@ -1165,7 +1165,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 *
@@ -1174,7 +1174,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 =