aboutsummaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-10 01:38:48 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-10 11:28:14 +0200
commitf9da2c9507f10a9193c9bd94d69cc85e53b58ba2 (patch)
tree00885e82f4ab7ff193d481637bbfdeb80c41d0a6 /src/environment.cpp
parent989aba1966373885d4cac306daea25e102f8d68d (diff)
downloadminetest-f9da2c9507f10a9193c9bd94d69cc85e53b58ba2.tar.gz
minetest-f9da2c9507f10a9193c9bd94d69cc85e53b58ba2.tar.bz2
minetest-f9da2c9507f10a9193c9bd94d69cc85e53b58ba2.zip
Immediate smoke puff when a normal entity is punched to death
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 6f1d8ff55..6a8943d12 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -1806,6 +1806,8 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
#ifndef SERVER
+#include "clientsimpleobject.h"
+
/*
ClientEnvironment
*/
@@ -1831,6 +1833,12 @@ ClientEnvironment::~ClientEnvironment()
delete i.getNode()->getValue();
}
+ for(core::list<ClientSimpleObject*>::Iterator
+ i = m_simple_objects.begin(); i != m_simple_objects.end(); i++)
+ {
+ delete *i;
+ }
+
// Drop/delete map
m_map->drop();
}
@@ -2108,6 +2116,22 @@ void ClientEnvironment::step(float dtime)
obj->updateLight(light);
}
}
+
+ /*
+ Step and handle simple objects
+ */
+ for(core::list<ClientSimpleObject*>::Iterator
+ i = m_simple_objects.begin(); i != m_simple_objects.end();)
+ {
+ ClientSimpleObject *simple = *i;
+ core::list<ClientSimpleObject*>::Iterator cur = i;
+ i++;
+ simple->step(dtime);
+ if(simple->m_to_be_removed){
+ delete simple;
+ m_simple_objects.erase(cur);
+ }
+ }
}
void ClientEnvironment::updateMeshes(v3s16 blockpos)
@@ -2119,6 +2143,11 @@ void ClientEnvironment::expireMeshes(bool only_daynight_diffed)
{
m_map->expireMeshes(only_daynight_diffed);
}
+
+void ClientEnvironment::addSimpleObject(ClientSimpleObject *simple)
+{
+ m_simple_objects.push_back(simple);
+}
ClientActiveObject* ClientEnvironment::getActiveObject(u16 id)
{