# HG changeset patch # User nemo # Date 1277345526 14400 # Node ID ca819f8bd7043bf0d872d828636858189a6f17e4 # Parent 149416b948fce9ee8f1ca9d6c68d0fdeaae740c3 Workaround for cakes and portals. Also disable something that always seems to screw up my portal games. Hopefully will so irritate sheepluva he comes up w/ something more workable. diff -r 149416b948fc -r ca819f8bd704 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Thu Jun 24 01:08:57 2010 +0200 +++ b/hedgewars/GSHandlers.inc Wed Jun 23 22:12:06 2010 -0400 @@ -2375,6 +2375,7 @@ dec(Gear^.Health); Gear^.Timer := Gear^.Health*10; + Gear^.PortalCounter:= 0; // This is not seconds, but at least it is *some* feedback if (Gear^.Health = 0) or ((Gear^.Message and gm_Attack) <> 0) then begin @@ -3234,7 +3235,7 @@ // wow! good candidate there, let's see if the distance really is small enough! if (Distance(Gear^.X-iterator^.X,Gear^.Y-iterator^.Y) > acptRadius) then continue; - +(* noTrap := ((not Gear^.dY.isNegative or (Gear^.dY.QWordValue = 0)) // can't be entered from above or ((conPortal^.dY.isNegative and not (conPortal^.dY.QWordValue = 0)))); @@ -3242,7 +3243,7 @@ // prevent getting stuck in a ground portal loop if noTrap and (iterator^.dY.QWordValue < _0_08.QWordValue) then - continue; + continue; *) iterator^.Active := true; iterator^.State := iterator^.State or gstMoving; @@ -3255,13 +3256,21 @@ cdxy := Distance(conPortal^.dX, conPortal^.dY); s := (Int2hwFloat(Gear^.Radius)) / cdxy; - iterator^.X := conPortal^.X + s * conPortal^.dX; - iterator^.Y := conPortal^.Y + s * conPortal^.dY; - - s := Distance(iterator^.dX, iterator^.dY) / cdxy; - - iterator^.dX := s * conPortal^.dX; - iterator^.dY := s * conPortal^.dY; + if iterator^.Kind = gtCake then + begin + iterator^.X := conPortal^.X ; + iterator^.Y := conPortal^.Y ; + end + else + begin + iterator^.X := conPortal^.X + s * conPortal^.dX; + iterator^.Y := conPortal^.Y + s * conPortal^.dY; + + s := Distance(iterator^.dX, iterator^.dY) / cdxy; + + iterator^.dX := s * conPortal^.dX; + iterator^.dY := s * conPortal^.dY + end; FollowGear := iterator;