From 0be621f4eaf3c5b456b7ded800cc1f5a4714bd4b Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Fri, 12 Nov 2010 00:27:36 +0000
Subject: [PATCH]     fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@1875 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/Level.lua      |  4 ++--
 game/engines/default/engine/Projectile.lua | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/game/engines/default/engine/Level.lua b/game/engines/default/engine/Level.lua
index 3e241a54ab..156d75dbfe 100644
--- a/game/engines/default/engine/Level.lua
+++ b/game/engines/default/engine/Level.lua
@@ -54,8 +54,8 @@ function _M:addEntity(e, after)
 end
 
 --- Removes an entity from the level
-function _M:removeEntity(e, no_warning)
-	if not no_warning and not self.entities[e.uid] then error("Entity "..e.uid.."("..e.name..") not present on the level") end
+function _M:removeEntity(e)
+	if not self.entities[e.uid] then error("Entity "..e.uid.."("..e.name..") not present on the level") end
 	self.entities[e.uid] = nil
 	for i = 1, #self.e_array do
 		if self.e_array[i] == e then
diff --git a/game/engines/default/engine/Projectile.lua b/game/engines/default/engine/Projectile.lua
index 68b9b939bf..b69d5b1e54 100644
--- a/game/engines/default/engine/Projectile.lua
+++ b/game/engines/default/engine/Projectile.lua
@@ -201,17 +201,17 @@ function _M:act()
 				if not radius_x then
 					radius_x, radius_y = self.old_x, self.old_y
 				end
-				self.src:projectDoStop(self.project.def.typ, self.project.def.tg, self.project.def.damtype, self.project.def.dam, self.project.def.particles, radius_x, radius_y, self.tmp_proj)
-				game.level:removeEntity(self, true)
+				game.level:removeEntity(self)
 				self.dead = true
+				self.src:projectDoStop(self.project.def.typ, self.project.def.tg, self.project.def.damtype, self.project.def.dam, self.project.def.particles, radius_x, radius_y, self.tmp_proj)
 			end
 		elseif self.homing then
 			self:moveDirection(self.homing.target.x, self.homing.target.y)
 			self.homing.count = self.homing.count - 1
 			if (self.x == self.homing.target.x and self.y == self.homing.target.y) or self.homing.count <= 0 then
-				self.homing.on_hit(self, self.src, self.homing.target)
-				game.level:removeEntity(self, true)
+				game.level:removeEntity(self)
 				self.dead = true
+				self.homing.on_hit(self, self.src, self.homing.target)
 			else
 				self.homing.on_move(self, self.src)
 			end
@@ -224,9 +224,9 @@ end
 --- Something moved in the same spot as us, hit ?
 function _M:on_move(x, y, target)
 	if self.project and self.project.def.typ.stop_block then
-		self.src:projectDoStop(self.project.def.typ, self.project.def.tg, self.project.def.damtype, self.project.def.dam, self.project.def.particles, self.x, self.y, self.tmp_proj)
-		game.level:removeEntity(self, true)
+		game.level:removeEntity(self)
 		self.dead = true
+		self.src:projectDoStop(self.project.def.typ, self.project.def.tg, self.project.def.damtype, self.project.def.dam, self.project.def.particles, self.x, self.y, self.tmp_proj)
 	end
 end
 
-- 
GitLab