Просмотр исходного кода

Destroy scene graph when unit gets deleted

Daniele Bartolini 12 лет назад
Родитель
Сommit
2c011ba029
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      engine/World.cpp

+ 3 - 0
engine/World.cpp

@@ -69,6 +69,9 @@ void World::destroy_unit(UnitId id)
 
 	Unit* unit = m_units.lookup(id);
 
+	// Destory unit's scene graph
+	m_graph_manager.destroy_scene_graph(&unit->m_scene_graph);
+
 	unit->destroy();
 	CE_DELETE(m_unit_pool, unit);
 	m_units.destroy(id);