summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 1a6a87487..2d1572d8e 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1836,7 +1836,7 @@ ParticleManager* Client::getParticleManager()
return &m_particle_manager;
}
-scene::IAnimatedMesh* Client::getMesh(const std::string &filename)
+scene::IAnimatedMesh* Client::getMesh(const std::string &filename, bool cache)
{
StringMap::const_iterator it = m_mesh_data.find(filename);
if (it == m_mesh_data.end()) {
@@ -1855,10 +1855,9 @@ scene::IAnimatedMesh* Client::getMesh(const std::string &filename)
scene::IAnimatedMesh *mesh = RenderingEngine::get_scene_manager()->getMesh(rfile);
rfile->drop();
- // NOTE: By playing with Irrlicht refcounts, maybe we could cache a bunch
- // of uniquely named instances and re-use them
mesh->grab();
- RenderingEngine::get_mesh_cache()->removeMesh(mesh);
+ if (!cache)
+ RenderingEngine::get_mesh_cache()->removeMesh(mesh);
return mesh;
}