diff -r ebc6759a6bb8 -r c3d3caad6d1e npf.c --- a/npf.c Sat Apr 02 07:19:03 2005 +0000 +++ b/npf.c Sat Apr 02 10:38:31 2005 +0000 @@ -332,6 +332,8 @@ TileIndex tile = current->tile; byte trackdir = current->direction; int32 cost = 0; + OpenListNode new_node; + /* Determine base length */ switch (GetTileType(tile)) { case MP_TUNNELBRIDGE: @@ -384,7 +386,8 @@ /* Penalise the tile if it is a target tile and the last signal was * red */ - if (as->EndNodeCheck(as, current)==AYSTAR_FOUND_END_NODE && NPFGetFlag(current, NPF_FLAG_LAST_SIGNAL_RED)) + new_node.path.node = *current; + if (as->EndNodeCheck(as, &new_node)==AYSTAR_FOUND_END_NODE && NPFGetFlag(current, NPF_FLAG_LAST_SIGNAL_RED)) cost += _patches.npf_rail_lastred_penalty; /* Check for slope */ @@ -409,8 +412,8 @@ } /* Will find any depot */ -int32 NPFFindDepot(AyStar* as, AyStarNode *node) { - TileIndex tile = node->tile; +int32 NPFFindDepot(AyStar* as, OpenListNode *current) { + TileIndex tile = current->path.node.tile; if (IsTileDepotType(tile, as->user_data[NPF_TYPE])) return AYSTAR_FOUND_END_NODE; else @@ -418,8 +421,9 @@ } /* Will find a station identified using the NPFFindStationOrTileData */ -int32 NPFFindStationOrTile(AyStar* as, AyStarNode *node) { +int32 NPFFindStationOrTile(AyStar* as, OpenListNode *current) { NPFFindStationOrTileData* fstd = (NPFFindStationOrTileData*)as->user_target; + AyStarNode *node = ¤t->path.node; TileIndex tile = node->tile; /* See if we checked this before */