diff options
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 29 |
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) { |