int walkActor(character *actor, int dx, int dy) { int currentDx = -1, currentDy = -1; if (!isPositionWalkable(dx, dy)) { printf("Invalid pathing destination: %i, %i\n", dx, dy); return 0; } if (TCOD_path_size(actor->path)) { TCOD_path_get_destination(actor->path, ¤tDx, ¤tDy); if (dx == currentDx && dy == currentDy) { return 1; } } if (!TCOD_path_compute(actor->path, actor->x, actor->y, dx, dy)) { //printf("Invalid path!\n"); return 0; } return 1; }
void TCODPath::getDestination(int *x,int *y) const { TCOD_path_get_destination(data,x,y); }