# HG changeset patch # User koda # Date 1254963497 0 # Node ID dbf195c3e09ce24dfe2e69c4d42d5ee35375de4d # Parent 41ebdb5f1e6e08247e113554710ce778839fc0b3 fix a very rare bug in which CurSlot becomes greater than cMaxCurSlot other minor changes to cmakefiles and iphone defaults diff -r 41ebdb5f1e6e -r dbf195c3e09c gameServer/CMakeLists.txt --- a/gameServer/CMakeLists.txt Wed Oct 07 17:01:40 2009 +0000 +++ b/gameServer/CMakeLists.txt Thu Oct 08 00:58:17 2009 +0000 @@ -4,9 +4,6 @@ message(FATAL_ERROR "Cannot find GHC") endif(NOT ghc_executable) -if(APPLE) - find_package(GMP REQUIRED) -endif(APPLE) set(hwserver_sources OfficialServer/DBInteraction.hs diff -r 41ebdb5f1e6e -r dbf195c3e09c hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Wed Oct 07 17:01:40 2009 +0000 +++ b/hedgewars/hwengine.pas Thu Oct 08 00:58:17 2009 +0000 @@ -264,9 +264,9 @@ isMusicEnabled:= false; isSoundEnabled:= false; cLocaleFName:= 'en.txt'; - cFullScreen:= false; + cFullScreen:= true; //T or F is is the same here cAltDamage:= false; - cShowFPS:= false; + cShowFPS:= true; val('8', cTimerInterval); cReducedQuality:= false; diff -r 41ebdb5f1e6e -r dbf195c3e09c hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Wed Oct 07 17:01:40 2009 +0000 +++ b/hedgewars/uAmmos.pas Thu Oct 08 00:58:17 2009 +0000 @@ -216,13 +216,16 @@ with Hedgehog do begin + if (Ammo^[CurSlot, CurAmmo].Count = 0) then begin CurAmmo:= 0; CurSlot:= 0; - while (CurSlot <= cMaxSlotIndex) and (Ammo^[CurSlot, CurAmmo].Count = 0) do inc(CurSlot) + while (CurSlot < cMaxSlotIndex) and (Ammo^[CurSlot, CurAmmo].Count = 0) do + inc(CurSlot) end; - + + //bad things could happen here in case CurSlot is overflowing ApplyAngleBounds(Hedgehog, Ammo^[CurSlot, CurAmmo].AmmoType); with Ammo^[CurSlot, CurAmmo] do @@ -257,7 +260,7 @@ begin CurAmmo:= 0; CurSlot:= 0; - while (CurSlot <= cMaxSlotIndex) and + while (CurSlot < cMaxSlotIndex) and ((Ammo^[CurSlot, CurAmmo].Count = 0) or (Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber >= 0)) do inc(CurSlot) diff -r 41ebdb5f1e6e -r dbf195c3e09c hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Wed Oct 07 17:01:40 2009 +0000 +++ b/hedgewars/uConsts.pas Thu Oct 08 00:58:17 2009 +0000 @@ -154,6 +154,7 @@ errmsgIncorrectUse = 'Incorrect use'; errmsgShouldntRun = 'This program shouldn''t be run manually'; errmsgWrongNumber = 'Wrong parameters number'; + errmsgSlotsOverflow = 'CurSlot overflowed'; msgLoading = 'Loading '; msgOK = 'ok'; diff -r 41ebdb5f1e6e -r dbf195c3e09c hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Wed Oct 07 17:01:40 2009 +0000 +++ b/hedgewars/uWorld.pas Thu Oct 08 00:58:17 2009 +0000 @@ -32,7 +32,11 @@ {$ENDIF} var FollowGear: PGear = nil; WindBarWidth: LongInt = 0; - bShowAmmoMenu: boolean = false; +{$IFDEF IPHONEOS} + bShowAmmoMenu: boolean = true; +{$ELSE} + bShowAmmoMenu: boolean = false; +{$ENDIF} bSelected: boolean = false; bShowFinger: boolean = false; Frames: Longword = 0; @@ -419,16 +423,12 @@ r.w:= 2 + TeamHealthBarWidth; r.h:= HealthTex^.h; - DrawFromRect(0, - cScreenHeight + DrawHealthY, - @r, HealthTex); + DrawFromRect(0, cScreenHeight + DrawHealthY, @r, HealthTex); inc(r.x, cTeamHealthWidth + 2); r.w:= 3; - DrawFromRect(TeamHealthBarWidth + 2, - cScreenHeight + DrawHealthY, - @r, HealthTex); + DrawFromRect(TeamHealthBarWidth + 2, cScreenHeight + DrawHealthY, @r, HealthTex); end; // Lag alert diff -r 41ebdb5f1e6e -r dbf195c3e09c tools/CreateMacBundle.cmake.in --- a/tools/CreateMacBundle.cmake.in Wed Oct 07 17:01:40 2009 +0000 +++ b/tools/CreateMacBundle.cmake.in Thu Oct 08 00:58:17 2009 +0000 @@ -10,9 +10,6 @@ execute_process(COMMAND cp -pPR ${VORBIS_LIBRARY} ${CMAKE_BINARY_DIR}/${frameworks_dir}/Vorbis.framework) if(SPARKLE_FOUND) -execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${CMAKE_BINARY_DIR}/${frameworks_dir}/Sparkle.framework) + execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${CMAKE_BINARY_DIR}/${frameworks_dir}/Sparkle.framework) endif() -if(${HAVE_NETSERVER}) -execute_process(COMMAND cp -pPR ${GMP_LIBRARY} ${CMAKE_BINARY_DIR}/${frameworks_dir}/GMP.framework) -endif()