--- a/ChangeLog.txt Wed Feb 07 02:26:31 2018 +0100
+++ b/ChangeLog.txt Wed Feb 07 03:50:38 2018 +0100
@@ -16,6 +16,7 @@
Lua API:
+ New call: WriteLnToChat(string): Add a line in the chat
+ * Fix call: SetWeapon(amNothing) now unselects weapon
====================== 0.9.23 ======================
HIGHLIGHTS:
--- a/hedgewars/uGearsHedgehog.pas Wed Feb 07 02:26:31 2018 +0100
+++ b/hedgewars/uGearsHedgehog.pas Wed Feb 07 03:50:38 2018 +0100
@@ -141,6 +141,16 @@
weap:= TAmmoType(HHGear^.MsgParam);
Hedgehog:= HHGear^.Hedgehog;
+HHGear^.Message:= HHGear^.Message and (not gmWeapon);
+
+// Special case: amNothing unselects weapon
+if weap = amNothing then
+ begin
+ HHGear^.Hedgehog^.CurAmmoType:= amNothing;
+ ApplyAmmoChanges(HHGear^.Hedgehog^);
+ exit
+ end;
+
if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then
exit; // weapon is not activated yet
@@ -148,8 +158,6 @@
t:= cMaxSlotAmmoIndex;
-HHGear^.Message:= HHGear^.Message and (not gmWeapon);
-
prevState:= HHGear^.State;
newState:= prevState;
with Hedgehog^ do