--- a/hedgewars/CCHandlers.inc Tue Feb 05 17:53:38 2008 +0000
+++ b/hedgewars/CCHandlers.inc Tue Feb 05 18:25:46 2008 +0000
@@ -310,11 +310,15 @@
procedure chSetWeapon(var s: shortstring);
begin
if (s[0] <> #1) or CheckNoTeamOrHH then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('w' + char(byte(s[1]) + 79));
+
+if TAmmoType(s[1]) > High(TAmmoType) then exit;
+
+if not CurrentTeam^.ExtDriven then SendIPC('w' + s);
+
with CurrentHedgehog^.Gear^ do
begin
Message:= Message or gm_Weapon;
- MsgParam:= byte(s[1]) - ord('a')
+ MsgParam:= byte(s[1])
end
end;