File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed 
internal/app/statemachine Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -102,11 +102,18 @@ func (s *BallPlacementPosDeterminer) Location() *geom.Vector2 {
102102	case  state .GameEvent_PLACEMENT_SUCCEEDED :
103103		return  s .keepCurrentPlacementPos ()
104104	case  state .GameEvent_PENALTY_KICK_FAILED :
105+ 		forTeam  :=  s .Event .GetPenaltyKickFailed ().ByTeam .Opposite ()
106+ 		sign  :=  1.0 
107+ 		if  ! s .State .TeamInfo (forTeam ).GetOnPositiveHalf () {
108+ 			sign  =  - 1.0 
109+ 		}
110+ 		y  :=  0.0 
105111		if  s .Event .GetPenaltyKickFailed ().Location  !=  nil  {
106- 			location  :=  s .Event .GetPenaltyKickFailed ().Location 
107- 			return  s .ballPlacementLocationGoalLine (location )
112+ 			y  =  s .Event .GetPenaltyKickFailed ().Location .GetY64 ()
108113		}
109- 		return  s .keepCurrentPlacementPos ()
114+ 		// the location is not trustworthy, because when a timeout occurs, the ball may be on the other field half 
115+ 		location  :=  geom .NewVector2 (sign * s .Geometry .FieldLength / 2 , y )
116+ 		return  s .ballPlacementLocationGoalLine (location )
110117	case  state .GameEvent_NO_PROGRESS_IN_GAME :
111118		return  s .validateLocation (s .Event .GetNoProgressInGame ().Location )
112119	case  state .GameEvent_PLACEMENT_FAILED ,
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments