From: <he...@us...> - 2014-05-13 14:54:05
|
Revision: 372 http://sourceforge.net/p/simspark/svn/372 Author: hedayat Date: 2014-05-13 14:54:02 +0000 (Tue, 13 May 2014) Log Message: ----------- * Clear Players in GoalLeft/Right before kickoff to make sure that opponent doesn't touch ball at the middle of the field. * Don't enforce crowding rules on kickoff, since opponent should not come near the ball Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-02-19 17:46:49 UTC (rev 371) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-05-13 14:54:02 UTC (rev 372) @@ -547,20 +547,28 @@ for(int unum=1; unum<=11; unum++) { - // I am the third closest player but i am too near the ball (and not the goalie) - if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance && - (distArr[unum][idx] <= mMin3PlDistance + 0.01 && ordArr[unum][idx] == 3)) + TPlayMode playMode = mGameState->GetPlayMode(); + if ((playMode == PM_KickOff_Left && idx != TI_LEFT) + || (playMode == PM_KickOff_Right && idx != TI_RIGHT) + || (playMode != PM_KickOff_Left && playMode != PM_KickOff_Right)) { - playerFoulTime[unum][idx]++; - playerLastFoul[unum][idx] = FT_Crowding; + // I am the third closest player but i am too near the ball (and not the goalie) + if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance + && (distArr[unum][idx] <= mMin3PlDistance + 0.01 + && ordArr[unum][idx] == 3)) + { + playerFoulTime[unum][idx]++; + playerLastFoul[unum][idx] = FT_Crowding; + } + // I am the second closest player but i am too near the ball (and not the goalie) + else if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance + && distArr[unum][idx] <= mMin2PlDistance + 0.01 + && ordArr[unum][idx] == 2) + { + playerFoulTime[unum][idx]++; + playerLastFoul[unum][idx] = FT_Crowding; + } } - // I am the second closest player but i am too near the ball (and not the goalie) - else if(unum != 1 && closestPlayerDist[idx2] < mMinOppDistance && - distArr[unum][idx] <= mMin2PlDistance + 0.01 && ordArr[unum][idx] == 2 ) - { - playerFoulTime[unum][idx]++; - playerLastFoul[unum][idx] = FT_Crowding; - } // Too many players inside my own penalty area and Im am the last one to enter or // the last one to enter was the goalie and I am the one further away from own goal else if((numPlInsideOwnArea[idx] > mMaxPlayersInsideOwnArea && unum != 1 && playerInsideOwnArea[unum][idx] == 1 && @@ -1631,7 +1639,11 @@ break; case PM_Goal_Left: + ClearPlayersBeforeKickOff(TI_RIGHT); + UpdateGoal(); + break; case PM_Goal_Right: + ClearPlayersBeforeKickOff(TI_LEFT); UpdateGoal(); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |