# HG changeset patch # User Wuzzy # Date 1493338701 -7200 # Node ID 2b1dd699b371a9f98f3061f76021e07e82a691c7 # Parent 92b4bab79c264d70525d359c7c0592d0a9ee5132 Lua: Fix SwitchHog breaking the ammo menu of the new hog diff -r 92b4bab79c26 -r 2b1dd699b371 ChangeLog.txt --- a/ChangeLog.txt Fri Apr 28 00:21:16 2017 +0200 +++ b/ChangeLog.txt Fri Apr 28 02:18:21 2017 +0200 @@ -250,6 +250,7 @@ + Locale library: loc_noop -- Mark string for translation but don't translate it + Animate library: AnimInit([startAnimating]) -- New parameter startAnimating: if true, will start game in cinematic mode with most controls disabled. Must play an animation after that * Fixed call: HideHog(gear) -- Fix crash when gear is invalid. Returns true on success or false otherwise + * Fixed call: SwitchHog(gear) -- Fix new hog being unable to open ammo menu * Removed call: SetAmmoStore -- Old undocumented function of questional use, has never been used 0.9.21 -> 0.9.22 diff -r 92b4bab79c26 -r 2b1dd699b371 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Fri Apr 28 00:21:16 2017 +0200 +++ b/hedgewars/uScript.pas Fri Apr 28 02:18:21 2017 +0200 @@ -1638,8 +1638,14 @@ end; SwitchCurrentHedgehog(gear^.Hedgehog); + AmmoMenuInvalidated:= true; CurrentTeam:= CurrentHedgehog^.Team; + repeat + CurrentTeam^.CurrHedgehog := (CurrentTeam^.CurrHedgehog + 1) mod CurrentTeam^.HedgehogsNumber + until + CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear = CurrentHedgehog^.Gear; + gear^.State:= gear^.State or gstHHDriven; gear^.Active := true; gear^.Z := cCurrHHZ;