Mark each gear with unique id
authorunc0rr
Thu, 20 Nov 2008 15:18:38 +0000
changeset 1503 a40b871d506b
parent 1502 db1f1dd12321
child 1504 1603a796f42a
Mark each gear with unique id
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Tue Nov 18 15:43:03 2008 +0000
+++ b/hedgewars/uGears.pas	Thu Nov 20 15:18:38 2008 +0000
@@ -52,6 +52,7 @@
 			Z: Longword;
 			IntersectGear: PGear;
 			TriggerId: Longword;
+			uid: Longword;
 			end;
 
 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
@@ -185,7 +186,7 @@
 begin
 inc(Counter);
 {$IFDEF DEBUGFILE}
-AddFileLog('AddGear: (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + inttostr(ord(Kind)));
+AddFileLog('AddGear: #' + inttostr(Counter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + inttostr(ord(Kind)));
 {$ENDIF}
 
 New(Result);
@@ -201,6 +202,7 @@
 Result^.CollisionIndex:= -1;
 Result^.Timer:= Timer;
 Result^.Z:= cUsualZ;
+Result^.uid:= Counter;
 
 if CurrentTeam <> nil then
    begin
@@ -382,7 +384,7 @@
 		end;
 
 {$IFDEF DEBUGFILE}
-with Gear^ do AddFileLog('Delete: (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + inttostr(ord(Kind)));
+with Gear^ do AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + inttostr(ord(Kind)));
 {$ENDIF}
 
 if Gear^.TriggerId <> 0 then TickTrigger(Gear^.TriggerId);