a patch :P
authorunc0rr
Sun, 01 Mar 2009 17:30:10 +0000
changeset 1850 a0332e79fdc9
parent 1849 2a989e5abda6
child 1851 b3b07f16a70d
a patch :P
hedgewars/CCHandlers.inc
hedgewars/uAmmos.pas
hedgewars/uConsole.pas
--- 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;
 
--- 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;
--- 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);