Переглянути джерело

Always destroy units by id

Daniele Bartolini 12 роки тому
батько
коміт
83378d1e17
3 змінених файлів з 1 додано та 10 видалено
  1. 0 8
      engine/World.cpp
  2. 0 1
      engine/World.h
  3. 1 1
      engine/lua/LuaWorld.cpp

+ 0 - 8
engine/World.cpp

@@ -74,14 +74,6 @@ void World::destroy_unit(UnitId id)
 	m_units.destroy(id);
 }
 
-//-----------------------------------------------------------------------------
-void World::destroy_unit(Unit* unit)
-{
-	CE_ASSERT_NOT_NULL(unit);
-
-	destroy_unit(unit->id());
-}
-
 //-----------------------------------------------------------------------------
 uint32_t World::num_units() const
 {

+ 0 - 1
engine/World.h

@@ -82,7 +82,6 @@ public:
 
 	UnitId								spawn_unit(const char* name, const Vector3& pos = Vector3::ZERO, const Quaternion& rot = Quaternion(Vector3(0, 1, 0), 0.0f));
 	void								destroy_unit(UnitId id);
-	void								destroy_unit(Unit* unit);
 
 	uint32_t							num_units() const;
 

+ 1 - 1
engine/lua/LuaWorld.cpp

@@ -57,7 +57,7 @@ CE_EXPORT int world_destroy_unit(lua_State* L)
 	World* world = stack.get_world(1);
 	Unit* unit = stack.get_unit(2);
 
-	world->destroy_unit(unit);
+	world->destroy_unit(unit->id());
 	return 0;
 }