Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Seminar-HFO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
Seminar-HFO
Commits
7e600ca6
Commit
7e600ca6
authored
Aug 12, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup on may_fix
parent
8e58bba0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
src/agent.cpp
src/agent.cpp
+9
-11
No files found.
src/agent.cpp
View file @
7e600ca6
...
...
@@ -977,11 +977,11 @@ bool Agent::doMarkPlayer(int unum) {
double
y
=
player_pos
.
y
+
(
kicker_pos
.
y
-
player_pos
.
y
)
*
0.1
;
bool
may_fix
=
wm
.
self
().
collidesWithPost
();
if
(
Body_GoToPoint
(
Vector2D
(
x
,
y
),
0.25
,
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
))
{
if
(
Body_GoToPoint
(
Vector2D
(
x
,
y
),
0.25
,
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
)
||
wm
.
self
().
collidesWithPost
())
{
// latter because sometimes fixes
return
true
;
}
else
{
return
may_fix
;
}
return
false
;
}
/*-------------------------------------------------------------------*/
...
...
@@ -1073,12 +1073,11 @@ bool Agent::doReduceAngleToGoal() {
double
dist_to_end2
=
targetLineEnd2
.
dist2
(
ball_pos
);
double
ratio
=
dist_to_end2
/
(
dist_to_end1
+
dist_to_end2
);
Vector2D
target
=
targetLineEnd1
*
ratio
+
targetLineEnd2
*
(
1
-
ratio
);
bool
may_fix
=
wm
.
self
().
collidesWithPost
();
if
(
Body_GoToPoint
(
target
,
0.25
,
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
))
{
if
(
Body_GoToPoint
(
target
,
0.25
,
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
)
||
wm
.
self
().
collidesWithPost
())
{
// latter because sometimes fixes
return
true
;
}
else
{
return
may_fix
;
}
return
false
;
}
/*-------------------------------------------------------------------*/
...
...
@@ -1102,13 +1101,12 @@ bool Agent::doDefendGoal() {
double
dist_to_post2
=
goal_pos2
.
dist2
(
ball_pos
);
double
ratio
=
dist_to_post2
/
(
dist_to_post1
+
dist_to_post2
);
Vector2D
target
=
goal_pos1
*
ratio
+
goal_pos2
*
(
1
-
ratio
);
bool
may_fix
=
wm
.
self
().
collidesWithPost
();
if
(
Body_GoToPoint
(
target
,
0.25
,
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
))
{
if
(
Body_GoToPoint
(
target
,
0.25
,
ServerParam
::
i
().
maxDashPower
()).
execute
(
this
)
||
wm
.
self
().
collidesWithPost
())
{
// latter because sometimes fixes
return
true
;
}
else
{
return
may_fix
;
}
return
false
;
}
/*-------------------------------------------------------------------*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment