mirror of https://github.com/OpenTTD/OpenTTD
Cleanup: remove unused Aystar variables
parent
77a7113ba6
commit
8349203038
|
@ -130,17 +130,12 @@ void AyStar::CheckTile(AyStarNode *current, OpenListNode *parent)
|
||||||
/* Check if this item is already in the OpenList */
|
/* Check if this item is already in the OpenList */
|
||||||
check = this->OpenListIsInList(current);
|
check = this->OpenListIsInList(current);
|
||||||
if (check != nullptr) {
|
if (check != nullptr) {
|
||||||
uint i;
|
|
||||||
/* Yes, check if this g value is lower.. */
|
/* Yes, check if this g value is lower.. */
|
||||||
if (new_g > check->g) return;
|
if (new_g > check->g) return;
|
||||||
this->openlist_queue.Delete(check, 0);
|
this->openlist_queue.Delete(check, 0);
|
||||||
/* It is lower, so change it to this item */
|
/* It is lower, so change it to this item */
|
||||||
check->g = new_g;
|
check->g = new_g;
|
||||||
check->path.parent = closedlist_parent;
|
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. */
|
/* Re-add it in the openlist_queue. */
|
||||||
this->openlist_queue.Push(check, new_f);
|
this->openlist_queue.Push(check, new_f);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -38,7 +38,6 @@ static const int AYSTAR_INVALID_NODE = -1; ///< Item is not valid (for example,
|
||||||
struct AyStarNode {
|
struct AyStarNode {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
Trackdir direction;
|
Trackdir direction;
|
||||||
uint user_data[2];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A path of nodes. */
|
/** A path of nodes. */
|
||||||
|
@ -115,7 +114,7 @@ typedef void AyStar_FoundEndNode(AyStar *aystar, OpenListNode *current);
|
||||||
*/
|
*/
|
||||||
struct AyStar {
|
struct AyStar {
|
||||||
/* These fields should be filled before initing the AyStar, but not changed
|
/* 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
|
/* These should point to the application specific routines that do the
|
||||||
* actual work */
|
* actual work */
|
||||||
|
@ -131,7 +130,6 @@ struct AyStar {
|
||||||
* afterwards, user_target should typically contain information about
|
* afterwards, user_target should typically contain information about
|
||||||
* what you where looking for, and user_data can contain just about
|
* what you where looking for, and user_data can contain just about
|
||||||
* everything */
|
* everything */
|
||||||
void *user_path;
|
|
||||||
void *user_target;
|
void *user_target;
|
||||||
void *user_data;
|
void *user_data;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue