summaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-07-31 17:29:25 +0200
committerPilzAdam <pilzadam@minetest.net>2013-08-13 23:48:47 +0200
commitfc571ad46df8f3dcc04745bc55d9ca6e1e82ed87 (patch)
treeddd55fdce5db910f3229ee183aac19f15933bfd4 /src/content_sao.cpp
parentd718b0b34eda84744778fa12a01d5be5f03753d3 (diff)
downloadminetest-fc571ad46df8f3dcc04745bc55d9ca6e1e82ed87.tar.gz
minetest-fc571ad46df8f3dcc04745bc55d9ca6e1e82ed87.tar.bz2
minetest-fc571ad46df8f3dcc04745bc55d9ca6e1e82ed87.zip
Add support for entities to automatic face movement direction
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index ed660cf10..f3ccd6db0 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "cpp_api/scriptapi.h"
#include "genericobject.h"
#include "util/serialize.h"
+#include "util/mathconstants.h"
std::map<u16, ServerActiveObject::Factory> ServerActiveObject::m_types;
@@ -522,6 +523,10 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
* dtime * m_acceleration;
m_velocity += dtime * m_acceleration;
}
+
+ if(m_prop.automatic_face_movement_dir){
+ m_yaw = atan2(m_velocity.Z,m_velocity.X) * 180 / M_PI;
+ }
}
if(m_registered){