hedgewars/uGearsHandlersMess.pas
changeset 14981 8c1a8673843f
parent 14960 088c1d319612
child 14998 fd29c23ff95e
--- a/hedgewars/uGearsHandlersMess.pas	Thu May 16 19:44:27 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Thu May 16 20:31:41 2019 +0200
@@ -3338,6 +3338,7 @@
     hedgehog: PHedgehog;
     State: Longword;
     switchDir: Longword;
+    oldUid: Longword;
 begin
     AllInactive := false;
 
@@ -3355,6 +3356,7 @@
     if (Gear^.Message and gmSwitch) <> 0 then
         begin
         HHGear := CurrentHedgehog^.Gear;
+        oldUid:= HHGear^.uid;
         HHGear^.Message := HHGear^.Message and (not gmSwitch);
         Gear^.Message := Gear^.Message and (not gmSwitch);
 
@@ -3387,6 +3389,7 @@
         AmmoMenuInvalidated:= true;
 
         HHGear := CurrentHedgehog^.Gear;
+        ScriptCall('onHogSwitch', oldUid);
         HHGear^.State := State;
         HHGear^.Active := true;
         FollowGear := HHGear;