|
From: <he...@us...> - 2011-05-13 21:56:18
|
Revision: 283
http://simspark.svn.sourceforge.net/simspark/?rev=283&view=rev
Author: hedayat
Date: 2011-05-13 21:56:12 +0000 (Fri, 13 May 2011)
Log Message:
-----------
Fixed a bug in goal counting
Modified Paths:
--------------
trunk/rcssserver3d/ChangeLog
trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp
Modified: trunk/rcssserver3d/ChangeLog
===================================================================
--- trunk/rcssserver3d/ChangeLog 2011-05-01 22:11:58 UTC (rev 282)
+++ trunk/rcssserver3d/ChangeLog 2011-05-13 21:56:12 UTC (rev 283)
@@ -1,3 +1,10 @@
+2011-05-14 Hedayat Vatankhah <hed...@gm...>
+
+ * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp
+ (SoccerRuleAspect::CheckGoal):
+ - fixed a small bug in goal counting which cause this function to always
+ count a goal when ball moved out of the field
+
2011-05-02 Hedayat Vatankhah <hed...@gm...>
* CMakeLists.txt:
Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp
===================================================================
--- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-05-01 22:11:58 UTC (rev 282)
+++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-05-13 21:56:12 UTC (rev 283)
@@ -1067,7 +1067,7 @@
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 @@
else
idx = TI_RIGHT;
}
+ else
+ return false;
}
// score the lucky team
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|