Fix up warnings (mostly loss of data cast warnings). When an ability gets interrupted, the key is required to be depressed before another cast attempt can be made. Added collision layer tiles to a few tiles in 1-1 due to ability to walk out-of-bounds.
This commit is contained in:
@@ -82,7 +82,7 @@ void Pathfinding::Initialize(){
|
||||
}
|
||||
|
||||
std::vector<vf2d> Pathfinding::Solve_AStar(vf2d startPos,vf2d endPos,float maxRange,bool upperLevel){
|
||||
float dist=sqrt(pow(endPos.x-startPos.x,2)+pow(endPos.y-startPos.y,2));
|
||||
float dist=float(sqrt(pow(endPos.x-startPos.x,2)+pow(endPos.y-startPos.y,2)));
|
||||
if(dist>maxRange*game->GetCurrentMap().tilewidth)return {};
|
||||
|
||||
nodeStart=&nodes[int(startPos.y/game->GetCurrentMap().tilewidth)*game->GetCurrentMap().width+int(startPos.x/game->GetCurrentMap().tilewidth)];
|
||||
@@ -108,7 +108,7 @@ std::vector<vf2d> Pathfinding::Solve_AStar(vf2d startPos,vf2d endPos,float maxRa
|
||||
|
||||
auto distance = [](sNode* a, sNode* b) // For convenience
|
||||
{
|
||||
return sqrtf((a->x - b->x)*(a->x - b->x) + (a->y - b->y)*(a->y - b->y));
|
||||
return sqrtf(float((a->x - b->x)*(a->x - b->x) + (a->y - b->y)*(a->y - b->y)));
|
||||
};
|
||||
|
||||
auto heuristic = [distance](sNode* a, sNode* b)
|
||||
|
||||
Reference in New Issue
Block a user