--- a/hedgewars/uVisualGears.pas Wed Dec 01 22:06:23 2010 +0300
+++ b/hedgewars/uVisualGears.pas Thu Dec 02 18:45:16 2010 -0500
@@ -30,6 +30,7 @@
procedure KickFlakes(Radius, X, Y: LongInt);
procedure DrawVisualGears(Layer: LongWord);
procedure DeleteVisualGear(Gear: PVisualGear);
+function VisualGearByUID(uid : Longword) : PVisualGear;
procedure AddClouds;
procedure AddDamageTag(X, Y, Damage, Color: LongWord);
@@ -480,6 +481,22 @@
end
end;
+function VisualGearByUID(uid : Longword) : PVisualGear;
+var vg: PVisualGear;
+begin
+VisualGearByUID:= nil;
+vg:= VisualGearsList;
+while vg <> nil do
+ begin
+ if vg^.uid = uid then
+ begin
+ VisualGearByUID:= vg;
+ exit
+ end;
+ vg:= vg^.NextGear
+ end
+end;
+
procedure AddClouds;
var i: LongInt;
begin