Commit 1a0ffa39 authored by drallensmith's avatar drallensmith

Cleanup on bhv_basic_move.cpp

parent b52d79a2
......@@ -61,7 +61,6 @@ Bhv_BasicMove::execute( PlayerAgent * agent )
dlog.addText( Logger::TEAM,
__FILE__": Bhv_BasicMove" );
bool success = false;
bool maybe_success = true;
//-----------------------------------------------
// tackle
......@@ -95,11 +94,6 @@ Bhv_BasicMove::execute( PlayerAgent * agent )
const double dash_power = Strategy::get_normal_dash_power( wm );
const BallObject& ball = wm.ball();
if (! ball.rposValid()) {
if (! wm.self().collidesWithPost()) {
maybe_success = false;
}
}
double dist_thr = ball.distFromSelf() * 0.1;
if ( dist_thr < 1.0 ) dist_thr = 1.0;
......@@ -113,16 +107,17 @@ Bhv_BasicMove::execute( PlayerAgent * agent )
agent->debugClient().setTarget( target_point );
agent->debugClient().addCircle( target_point, dist_thr );
if ( ! Body_GoToPoint( target_point, dist_thr, dash_power
).execute( agent ) )
{
if (! Body_TurnToBall().execute( agent )) {
success = false;
if ( Body_GoToPoint( target_point, dist_thr, dash_power
).execute( agent ) ||
Body_TurnToBall().execute( agent ) ) {
if (ball.rposValid() || wm.self().collidesWithPost()) {
success = true;
} else {
success = maybe_success;
success = false;
}
} else {
success = maybe_success;
success = false;
}
if ( wm.existKickableOpponent() &&
......
......@@ -5,7 +5,6 @@
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <vector>
namespace hfo {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment