# HG changeset patch # User Wuzzy # Date 1533561625 -7200 # Node ID 92b87845beeb6abd1be476f60f6a1e8630ec090d # Parent 212036414957fdac5c7739e1c86566a2bd45e0a1 Fix cake rotation angle after bounce from bounce edge diff -r 212036414957 -r 92b87845beeb hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Fri Aug 03 00:39:50 2018 +0200 +++ b/hedgewars/uGearsHandlersMess.pas Mon Aug 06 15:20:25 2018 +0200 @@ -3535,6 +3535,7 @@ var tdx, tdy: hwFloat; cakeData: PCakeData; + i: Longword; begin AllInactive := false; @@ -3566,12 +3567,26 @@ Gear^.WDTimer := 0; Gear^.Angle := (LongInt(Gear^.Angle) + 2) and 3; Gear^.Karma := 0; + + // Reset CakePoints to fix cake angle + cakeData:= PCakeData(Gear^.Data); + with cakeData^ do + begin + for i:= 0 to Pred(cakeh) do + begin + CakePoints[i].x := Gear^.X; + CakePoints[i].y := Gear^.Y; + end; + CakeI:= 0; + end; + Gear^.Tag:= 0; end else if (Gear^.Karma = 2) then begin - // Cake doesn't know how walk through world wrap - // so it gives up and stops. - // TODO: Teach cake how to deal with world wrap. + (* Cake passed world edge. + Cake doesn't know yet how walk through + world wrap so it gives up and stops. + TODO: Teach cake how to deal with world wrap. *) Gear^.Health := 0; Gear^.Karma := 0; end;