# HG changeset patch # User unc0rr # Date 1338890848 -14400 # Node ID aff30d80bd7bb9e9e85b30477325ec43053137cf # Parent 92a04515625586377ed46a3ea7ed69140ba17c6c - Allow camera movement while current hedgehog is falling - Some tiny changes diff -r 92a045156255 -r aff30d80bd7b hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Tue Jun 05 19:36:07 2012 +0200 +++ b/hedgewars/uCommandHandlers.pas Tue Jun 05 14:07:28 2012 +0400 @@ -436,7 +436,7 @@ end else TryDo(checksum = lastTurnChecksum, 'Desync detected', true); - AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks)); + AddFileLog('Next turn: time '+inttostr(GameTicks)); end; procedure chTimer(var s: shortstring); diff -r 92a045156255 -r aff30d80bd7b hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Tue Jun 05 19:36:07 2012 +0200 +++ b/hedgewars/uGearsHedgehog.pas Tue Jun 05 14:07:28 2012 +0400 @@ -707,12 +707,10 @@ if (Gear^.Message and gmLeft )<>0 then Gear^.dX:= -cLittle else if (Gear^.Message and gmRight )<>0 then - Gear^.dX:= cLittle else exit; + Gear^.dX:= cLittle + else exit; - if (Gear^.Message and (gmLeft or gmRight)) <> 0 then - begin - StepSoundTimer:= cHHStepTicks; - end; + StepSoundTimer:= cHHStepTicks; GHStepTicks:= cHHStepTicks; if PrevdX <> hwSign(Gear^.dX) then @@ -837,6 +835,7 @@ if (CurrentHedgehog^.Gear = Gear) and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then begin + // TODO: why so aggressive at setting FollowGear when falling? FollowGear:= Gear; end; if isUnderwater then diff -r 92a045156255 -r aff30d80bd7b hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Tue Jun 05 19:36:07 2012 +0200 +++ b/hedgewars/uWorld.pas Tue Jun 05 14:07:28 2012 +0400 @@ -1606,7 +1606,10 @@ {$ENDIF} z:= round(200/zoom); if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) then - if (not autoCameraOn) or ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then + if (not autoCameraOn) then + FollowGear:= nil + else + if ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then begin FollowGear:= nil; prevPoint:= CursorPoint; @@ -1656,7 +1659,7 @@ EdgesDist:= cGearScrEdgesDist; // this generates the border around the screen that moves the camera when cursor is near it -if isCursorVisible or (FollowGear <> nil) then +if isCursorVisible or ((FollowGear <> nil) and autoCameraOn) then begin if CursorPoint.X < - cScreenWidth div 2 + EdgesDist then begin