# HG changeset patch # User nemo # Date 1310141907 14400 # Node ID c49a84b04d2204c83ebb30f22f456462f3fb90ad # Parent 1b81dc7d238be1a6255917dce3f4df177ef0e18b Add fudge factors for the collision check on portal exit diff -r 1b81dc7d238b -r c49a84b04d22 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Thu Jul 07 08:09:12 2011 -0400 +++ b/hedgewars/GSHandlers.inc Fri Jul 08 12:18:27 2011 -0400 @@ -3756,13 +3756,19 @@ or (iterator^.Y < Gear^.Y - r) or (iterator^.Y > Gear^.Y + r) then continue; - +(* +Square check causes fail on many innocent cases. the 3/4s and 1.5 fudge factors... help. +Might still need to remove this section +*) //Will if fit through? //set r to be portal distance - r := Int2hwFloat(Gear^.Radius +1); - - o_x := hwRound(conPortal^.X + conPortal^.dX); - o_y := hwRound(conPortal^.Y + conPortal^.dY); + r := Int2hwFloat(Gear^.Radius * 3 div 4); + o_x := hwRound(conPortal^.X + (conPortal^.dX*_1_5)); + o_y := hwRound(conPortal^.Y + (conPortal^.dY*_1_5)); + //r := Int2hwFloat(Gear^.Radius +1); + + //o_x := hwRound(conPortal^.X + conPortal^.dX); + //o_y := hwRound(conPortal^.Y + conPortal^.dY); r_x := hwRound(conPortal^.X+r*conPortal^.dX); r_y := hwRound(conPortal^.Y+r*conPortal^.dY); rr_x := hwRound(conPortal^.X+r*conPortal^.dX*2);