--- a/hedgewars/uConsts.pas Tue Aug 07 13:21:15 2012 -0400
+++ b/hedgewars/uConsts.pas Wed Aug 08 10:26:10 2012 -0400
@@ -245,6 +245,7 @@
gmRemoveFromList = $00004000;
gmAddToList = $00008000;
+ gmDelete = $00010000;
gmAllStoppable = gmLeft or gmRight or gmUp or gmDown or gmAttack or gmPrecise;
cMaxSlotIndex = 9;
--- a/hedgewars/uGears.pas Tue Aug 07 13:21:15 2012 -0400
+++ b/hedgewars/uGears.pas Wed Aug 08 10:26:10 2012 -0400
@@ -207,6 +207,8 @@
curHandledGear:= t;
t:= curHandledGear^.NextGear;
+ if curHandledGear^.Message and gmDelete <> 0 then
+ DeleteGear(curHandledGear);
if curHandledGear^.Message and gmRemoveFromList <> 0 then
begin
RemoveGearFromList(curHandledGear);
--- a/hedgewars/uScript.pas Tue Aug 07 13:21:15 2012 -0400
+++ b/hedgewars/uScript.pas Wed Aug 08 10:26:10 2012 -0400
@@ -412,7 +412,7 @@
begin
gear:= GearByUID(lua_tointeger(L, 1));
if gear <> nil then
- DeleteGear(gear);
+ gear^.Message:= gear^.Message or gmDelete;
end;
lc_deletegear:= 0
end;