Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 889298c631ff472bc9ec528983abdc7e > files > 1

rcssserver3d-0.6.5-2.fc13.src.rpm

diff -up rcssserver3d-0.6.5/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp.goalfix rcssserver3d-0.6.5/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp
--- rcssserver3d-0.6.5/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp.goalfix	2011-05-14 02:28:04.896457224 +0430
+++ rcssserver3d-0.6.5/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp	2011-05-14 02:28:35.700072126 +0430
@@ -4,7 +4,7 @@
    Fri May 9 2003
    Copyright (C) 2002,2003 Koblenz University
    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
-   $Id: soccerruleaspect.cpp 269 2011-04-21 13:55:47Z hedayat $
+   $Id: soccerruleaspect.cpp 283 2011-05-13 21:56:12Z hedayat $
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1067,7 +1067,7 @@ SoccerRuleAspect::CheckGoal()
         salt::Vector3f normBVel = mBallBody->GetVelocity();
         // ball should be inside the field recently (assumes that the simulation
         // step size is smaller than 1 second)
-        if (ballPos.x() - normBVel.x() > mGoalBallLineX)
+        if (fabs(ballPos.x() - normBVel.x()) > mGoalBallLineX)
             return false;
 
         normBVel.Normalize();
@@ -1083,6 +1083,8 @@ SoccerRuleAspect::CheckGoal()
             else
                 idx = TI_RIGHT;
         }
+        else
+            return false;
     }
 
     // score the lucky team