# HG changeset patch # User sheepluva # Date 1288489815 -3600 # Node ID 8972dd38bbad383efe1e3545565a0f5a59958a7a # Parent 0f8ec120e90d3350f826992f77d034dc165fb742 potential fix for Issue #86: 'Objects behind a portal will sometimes go through the portal.' please test diff -r 0f8ec120e90d -r 8972dd38bbad hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat Oct 30 21:48:47 2010 -0400 +++ b/hedgewars/GSHandlers.inc Sun Oct 31 02:50:15 2010 +0100 @@ -3413,8 +3413,20 @@ hasdxy := ((iterator^.dX.QWordValue <> 0) or (iterator^.dY.QWordValue <> 0)); + // in case the object is not moving, let's asume it's moving towards the portal + if not hasdxy then + begin + ox:= Gear^.X - iterator^.X; + oy:= Gear^.Y - iterator^.Y; + end + else + begin + ox:= iterator^.dX; + oy:= iterator^.dY; + end; + // won't port stuff that moves away from me! - if hasdxy and not (Gear^.dX*iterator^.dX + Gear^.dY*iterator^.dY).isNegative then + if not (Gear^.dX*ox + Gear^.dY*oy).isNegative then continue; if (iterator^.Kind <> gtCake) then