# HG changeset patch # User unc0rr # Date 1235928610 0 # Node ID a0332e79fdc9bc321f4616473ca2038e9f253134 # Parent 2a989e5abda6a15ddd0313db63d616d74aadee9d a patch :P diff -r 2a989e5abda6 -r a0332e79fdc9 hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Sun Mar 01 17:24:25 2009 +0000 +++ b/hedgewars/CCHandlers.inc Sun Mar 01 17:30:10 2009 +0000 @@ -364,14 +364,14 @@ begin if (s[0] <> #1) or CheckNoTeamOrHH then exit; -if TAmmoType(LongInt(s[1])-33) > High(TAmmoType) then exit; +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(LongInt(s[1])-33) + MsgParam:= byte(s[1]) end end; diff -r 2a989e5abda6 -r a0332e79fdc9 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Sun Mar 01 17:24:25 2009 +0000 +++ b/hedgewars/uAmmos.pas Sun Mar 01 17:30:10 2009 +0000 @@ -225,7 +225,7 @@ procedure SetWeapon(weap: TAmmoType); begin -ParseCommand('/setweap ' + char(LongInt(weap)+33), true) +ParseCommand('/setweap ' + char(weap), true) end; procedure DisableSomeWeapons; diff -r 2a989e5abda6 -r a0332e79fdc9 hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Sun Mar 01 17:24:25 2009 +0000 +++ b/hedgewars/uConsole.pas Sun Mar 01 17:30:10 2009 +0000 @@ -100,14 +100,16 @@ var i, t: LongInt; begin i:= Pos(' ', a); -if i>0 then - begin - for t:= 1 to Pred(i) do - if (a[t] >= 'A')and(a[t] <= 'Z') then Inc(a[t], 32); - b:= copy(a, i + 1, Length(a) - i); - while (b[0]<>#0) and (b[1]=#32) do Delete(b, 1, 1); - byte(a[0]):= Pred(i) - end else b:= ''; +if i > 0 then + begin + for t:= 1 to Pred(i) do + if (a[t] >= 'A')and(a[t] <= 'Z') then Inc(a[t], 32); + b:= copy(a, i + 1, Length(a) - i); + while (b[0] <> #0) do + Delete(b, 1, 1); + + byte(a[0]):= Pred(i) + end else b:= ''; end; procedure WriteToConsole(s: shortstring);