We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95d560e commit b2f3918Copy full SHA for b2f3918
rcsc/action/body_smart_kick.cpp
@@ -110,10 +110,13 @@ Body_SmartKick::execute( PlayerAgent * agent )
110
M_sequence.power_,
111
(int)M_sequence.pos_list_.size() );
112
113
- Vector2D vel = M_sequence.pos_list_.front() - wm.ball().pos();
114
- Vector2D kick_accel = vel - wm.ball().vel();
115
- agent->doKick( kick_accel.r() / wm.self().kickRate(),
+ if ( wm.ball().posValid() )
+ {
+ Vector2D vel = M_sequence.pos_list_.front() - wm.ball().pos();
116
+ Vector2D kick_accel = vel - wm.ball().vel();
117
+ agent->doKick( kick_accel.r() / wm.self().kickRate(),
118
kick_accel.th() - wm.self().body() );
119
+ }
120
return true;
121
}
122
0 commit comments