add a uid to VGs for purpose of Lua manipulation
authornemo
Fri, 26 Nov 2010 15:31:57 -0500
changeset 4422 5e8cfef25ccb
parent 4421 58c6918acde4
child 4423 4391526e436e
add a uid to VGs for purpose of Lua manipulation
hedgewars/uTypes.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/uTypes.pas	Fri Nov 26 10:21:53 2010 -0500
+++ b/hedgewars/uTypes.pas	Fri Nov 26 15:31:57 2010 -0500
@@ -235,6 +235,7 @@
         Hedgehog: PHedgehog;
         Text: shortstring;
         Tint: Longword;
+        uid: Longword;
         end;
 
     TStatistics = record
--- a/hedgewars/uVisualGears.pas	Fri Nov 26 10:21:53 2010 -0500
+++ b/hedgewars/uVisualGears.pas	Fri Nov 26 15:31:57 2010 -0500
@@ -97,6 +97,7 @@
         );
 
 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear;
+const VGCounter: Longword = 0;
 var gear: PVisualGear;
     t: Longword;
     sp: real;
@@ -124,6 +125,7 @@
       exit
     end;
 
+inc(VGCounter);
 New(gear);
 FillChar(gear^, sizeof(TVisualGear), 0);
 gear^.X:= real(X);
@@ -132,6 +134,7 @@
 gear^.doStep:= doStepHandlers[Kind];
 gear^.State:= 0;
 gear^.Tint:= $FFFFFFFF;
+gear^.uid:= VGCounter;
 
 with gear^ do
     case Kind of