Cleanup: remove unused Aystar variables

This commit is contained in:
Rubidium 2024-05-12 08:58:22 +02:00 committed by rubidium42
parent 77a7113ba6
commit 8349203038
2 changed files with 1 additions and 8 deletions

View File

@ -130,17 +130,12 @@ void AyStar::CheckTile(AyStarNode *current, OpenListNode *parent)
/* Check if this item is already in the OpenList */
check = this->OpenListIsInList(current);
if (check != nullptr) {
uint i;
/* Yes, check if this g value is lower.. */
if (new_g > check->g) return;
this->openlist_queue.Delete(check, 0);
/* It is lower, so change it to this item */
check->g = new_g;
check->path.parent = closedlist_parent;
/* Copy user data, will probably have changed */
for (i = 0; i < lengthof(current->user_data); i++) {
check->path.node.user_data[i] = current->user_data[i];
}
/* Re-add it in the openlist_queue. */
this->openlist_queue.Push(check, new_f);
} else {

View File

@ -38,7 +38,6 @@ static const int AYSTAR_INVALID_NODE = -1; ///< Item is not valid (for example,
struct AyStarNode {
TileIndex tile;
Trackdir direction;
uint user_data[2];
};
/** A path of nodes. */
@ -115,7 +114,7 @@ typedef void AyStar_FoundEndNode(AyStar *aystar, OpenListNode *current);
*/
struct AyStar {
/* These fields should be filled before initing the AyStar, but not changed
* afterwards (except for user_data and user_path)! (free and init again to change them) */
* afterwards (except for user_data)! (free and init again to change them) */
/* These should point to the application specific routines that do the
* actual work */
@ -131,7 +130,6 @@ struct AyStar {
* afterwards, user_target should typically contain information about
* what you where looking for, and user_data can contain just about
* everything */
void *user_path;
void *user_target;
void *user_data;