From 8cae65978611476d0da215acf61819a905c68267 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Fri, 14 Jun 2013 12:04:46 +0000 Subject: Add an option to disable object <-> object collision for Lua entities --- src/content_sao.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 993859f1c..6b3593ec7 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -68,6 +68,10 @@ public: return false; } + bool collideWithObjects() { + return false; + } + private: }; @@ -140,6 +144,10 @@ public: return false; } + bool collideWithObjects() { + return false; + } + private: float m_timer1; float m_age; @@ -325,6 +333,9 @@ public: return false; } + bool collideWithObjects() { + return false; + } private: std::string m_itemstring; @@ -500,7 +511,8 @@ void LuaEntitySAO::step(float dtime, bool send_recommended) v3f p_acceleration = m_acceleration; moveresult = collisionMoveSimple(m_env,m_env->getGameDef(), pos_max_d, box, stepheight, dtime, - p_pos, p_velocity, p_acceleration,this); + p_pos, p_velocity, p_acceleration, + this, m_prop.collideWithObjects); // Apply results m_base_position = p_pos; m_velocity = p_velocity; @@ -905,6 +917,10 @@ bool LuaEntitySAO::getCollisionBox(aabb3f *toset) { return false; } +bool LuaEntitySAO::collideWithObjects(){ + return m_prop.collideWithObjects; +} + /* PlayerSAO */ @@ -1496,3 +1512,7 @@ bool PlayerSAO::getCollisionBox(aabb3f *toset) { return true; } + +bool PlayerSAO::collideWithObjects(){ + return true; +} -- cgit v1.2.3