Skip to content

modifying is_goal function #7

@aash29

Description

@aash29

I wanted to slightly change pathfinding algorithm to find a way to cells adjacent to goal. However,
setting is_goal function in navigator class to

static bool is_goal(location_t &pos, location_t &goal) {
	return (std::max(abs(pos.x-goal.x),abs(pos.y-goal.y))<=1);
}

results in unexpected behavior (stopping 2 steps from goal, then teleporting to it). What is the right way to do this?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions