# HG changeset patch # User unc0rr # Date 1202235946 0 # Node ID b203147d91b558f1266d0fad84b77d2b595eff6d # Parent 4f59db6f147d7a63c79b328cab460bdd27ce9b78 - Handle new command in game record and net - Inc protocol version due to changes diff -r 4f59db6f147d -r b203147d91b5 CMakeLists.txt --- a/CMakeLists.txt Tue Feb 05 17:53:38 2008 +0000 +++ b/CMakeLists.txt Tue Feb 05 18:25:46 2008 +0000 @@ -9,7 +9,7 @@ endif(DEFINED DATA_INSTALL_DIR) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -set(HEDGEWARS_PROTO_VER 8) +set(HEDGEWARS_PROTO_VER 9) add_subdirectory(bin) add_subdirectory(QTfrontend) diff -r 4f59db6f147d -r b203147d91b5 hedgewars/CCHandlers.inc --- 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; diff -r 4f59db6f147d -r b203147d91b5 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Tue Feb 05 17:53:38 2008 +0000 +++ b/hedgewars/uAmmos.pas Tue Feb 05 18:25:46 2008 +0000 @@ -217,7 +217,7 @@ procedure SetWeapon(weap: TAmmoType); begin -ParseCommand('/setweap ' + chr(ord('a') + byte(weap)), true) +ParseCommand('/setweap ' + char(weap), true) end; end. diff -r 4f59db6f147d -r b203147d91b5 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Tue Feb 05 17:53:38 2008 +0000 +++ b/hedgewars/uIO.pas Tue Feb 05 18:25:46 2008 +0000 @@ -258,6 +258,7 @@ CursorPoint.X:= SmallInt(SDLNet_Read16(@(headcmd^.X)) + WorldDx); CursorPoint.Y:= SmallInt(SDLNet_Read16(@(headcmd^.Y)) + WorldDy); end; + 'w': ParseCommand('setweap ' + headcmd^.str[2], true); '1'..'5': ParseCommand('timer ' + headcmd^.cmd, true); #128..char(128 + cMaxSlotIndex): ParseCommand('slot ' + char(byte(headcmd^.cmd) - 79), true) end;