# HG changeset patch # User unc0rr # Date 1227194318 0 # Node ID a40b871d506bef70b30873e56cc3af47a55c4edd # Parent db1f1dd12321ac7f4b091f747147001fceb09636 Mark each gear with unique id diff -r db1f1dd12321 -r a40b871d506b 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);