[Fix] Changed abs(Vec2::DistanceSquared(thisPos, goalPos)); to fabs(Vec2::DistanceSquared(thisPos, goalPos));
This commit is contained in:
parent
8b92224e72
commit
7ca0ad0d7d
@ -1,5 +1,5 @@
|
|||||||
#include "NPC.h"
|
#include "NPC.h"
|
||||||
#include "../Unuk/Player.h"
|
#include "../../Unuk/Player.h"
|
||||||
|
|
||||||
NPC::NPC(LevelGen* mapArg) : Character(mapArg) {
|
NPC::NPC(LevelGen* mapArg) : Character(mapArg) {
|
||||||
_moveTimer.Start();
|
_moveTimer.Start();
|
||||||
|
@ -19,7 +19,7 @@ bool MapTile::IsGoal(MapTile& tile) {
|
|||||||
float MapTile::GoalDistanceEstimate(MapTile& goal) {
|
float MapTile::GoalDistanceEstimate(MapTile& goal) {
|
||||||
Vec2 thisPos(_tile.GetX(), _tile.GetY());
|
Vec2 thisPos(_tile.GetX(), _tile.GetY());
|
||||||
Vec2 goalPos(goal.GetTileX(), goal.GetTileY());
|
Vec2 goalPos(goal.GetTileX(), goal.GetTileY());
|
||||||
return abs(Vec2::DistanceSquared(thisPos, goalPos));
|
return fabs(Vec2::DistanceSquared(thisPos, goalPos));
|
||||||
}
|
}
|
||||||
|
|
||||||
float MapTile::GetCost(MapTile& goal) {
|
float MapTile::GetCost(MapTile& goal) {
|
||||||
|
Loading…
Reference in New Issue
Block a user