# HG changeset patch # User Wuzzy # Date 1558031501 -7200 # Node ID 8c1a8673843f02f899718be404bf24f5c12c3f42 # Parent fdfe8bf91b8bc24448eeea0212af8c243fa002b7 Add Lua callback onHogSwitch diff -r fdfe8bf91b8b -r 8c1a8673843f ChangeLog.txt --- a/ChangeLog.txt Thu May 16 19:44:27 2019 +0200 +++ b/ChangeLog.txt Thu May 16 20:31:41 2019 +0200 @@ -135,6 +135,7 @@ + Utils library: New calls: getReadableChallengeRecord, updateChallengeRecord, integerSqrt, integerHypotenuse + New callback: onGameResult(winningClan): Called when the game ends normally. winningClan = index of winning clan or -1 on draw + New callback: onCaseDrop(gear): Called at the point where a crate MIGHT be dropped between turns. Gear is the crate gear or nil + + New callback: ooHogSwitch(oldHog): Called when hogs was switched with the “switch hedgehog” utility + New callback: onPreciseLocal(): Called when precise key is pressed client-side + SendStat extension: Option to use predefined modes with siPointType, like "!POINTS" or "!TIME" + SimpleMission: Add isMissionTeam attribute for teams diff -r fdfe8bf91b8b -r 8c1a8673843f hedgewars/uGearsHandlersMess.pas --- 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;