mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-05-13 07:54:50 +00:00
climb is more expensive
This commit is contained in:
parent
3ffeca39d0
commit
86e9d76034
@ -1794,6 +1794,7 @@ AStarSearch(start, goal, team, greedy_path)
|
|||||||
{
|
{
|
||||||
child = level.waypoints[bestNode.index].children[i];
|
child = level.waypoints[bestNode.index].children[i];
|
||||||
childorg = level.waypoints[child].origin;
|
childorg = level.waypoints[child].origin;
|
||||||
|
childtype = level.waypoints[child].type;
|
||||||
|
|
||||||
penalty = 1;
|
penalty = 1;
|
||||||
if(!greedy_path && isdefined(team))
|
if(!greedy_path && isdefined(team))
|
||||||
@ -1803,6 +1804,10 @@ AStarSearch(start, goal, team, greedy_path)
|
|||||||
penalty = temppen;
|
penalty = temppen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// have certain types of nodes more expensive
|
||||||
|
if (childtype == "climb" || childtype == "prone")
|
||||||
|
penalty++;
|
||||||
|
|
||||||
//calc the total path we have took
|
//calc the total path we have took
|
||||||
newg = bestNode.g + DistanceSquared(nodeorg, childorg)*penalty;//bots on same team's path are more expensive
|
newg = bestNode.g + DistanceSquared(nodeorg, childorg)*penalty;//bots on same team's path are more expensive
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user