Merge branch 'master' into jgrpp
# Conflicts: # src/aircraft_cmd.cpp # src/autoreplace_cmd.cpp # src/pathfinder/follow_track.hpp # src/pathfinder/yapf/yapf_rail.cpp # src/saveload/afterload.cpp # src/saveload/saveload.cpp # src/script/api/ai/ai_station.hpp.sq # src/script/api/game/game_station.hpp.sq # src/script/api/script_station.hpp # src/track_func.h # src/vehicle_base.h
This commit is contained in:
@@ -126,8 +126,13 @@ struct CFollowTrackT
|
||||
m_old_tile = old_tile;
|
||||
m_old_td = old_td;
|
||||
m_err = EC_NONE;
|
||||
assert_tile(((TrackStatusToTrackdirBits(GetTileTrackStatus(m_old_tile, TT(), IsRoadTT() ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0)) & TrackdirToTrackdirBits(m_old_td)) != 0) ||
|
||||
(IsTram() && GetSingleTramBit(m_old_tile) != INVALID_DIAGDIR) || (IsRailTT() && IsRailCustomBridgeHeadTile(m_old_tile)), m_old_td); // Disable the assertion for single tram bits
|
||||
assert_tile(
|
||||
((TrackStatusToTrackdirBits(
|
||||
GetTileTrackStatus(m_old_tile, TT(), (IsRoadTT() && m_veh != NULL) ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0)
|
||||
) & TrackdirToTrackdirBits(m_old_td)) != 0) ||
|
||||
(IsTram() && GetSingleTramBit(m_old_tile) != INVALID_DIAGDIR), // Disable the assertion for single tram bits
|
||||
m_old_tile
|
||||
);
|
||||
m_exitdir = TrackdirToExitdir(m_old_td);
|
||||
if (ForcedReverse()) return true;
|
||||
if (!CanExitOldTile()) return false;
|
||||
|
@@ -156,7 +156,7 @@ void AyStar::CheckTile(AyStarNode *current, OpenListNode *parent)
|
||||
* his neighbour items. If they are valid, they are added to be checked too.
|
||||
* @return Possible values:
|
||||
* - #AYSTAR_EMPTY_OPENLIST : indicates all items are tested, and no path has been found.
|
||||
* - #AYSTAR_LIMIT_REACHED : Indicates that the max_nodes limit has been reached.
|
||||
* - #AYSTAR_LIMIT_REACHED : Indicates that the max_search_nodes limit has been reached.
|
||||
* - #AYSTAR_FOUND_END_NODE : indicates we found the end. Path_found now is true, and in path is the path found.
|
||||
* - #AYSTAR_STILL_BUSY : indicates we have done this tile, did not found the path yet, and have items left to try.
|
||||
*/
|
||||
|
@@ -30,7 +30,7 @@ enum AystarStatus {
|
||||
AYSTAR_EMPTY_OPENLIST, ///< All items are tested, and no path has been found.
|
||||
AYSTAR_STILL_BUSY, ///< Some checking was done, but no path found yet, and there are still items left to try.
|
||||
AYSTAR_NO_PATH, ///< No path to the goal was found.
|
||||
AYSTAR_LIMIT_REACHED, ///< The #max_nodes limit has been reached, aborting search.
|
||||
AYSTAR_LIMIT_REACHED, ///< The #AyStar::max_search_nodes limit has been reached, aborting search.
|
||||
AYSTAR_DONE, ///< Not an end-tile, or wrong direction.
|
||||
};
|
||||
|
||||
@@ -93,9 +93,9 @@ typedef int32 AyStar_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNod
|
||||
typedef int32 AyStar_CalculateH(AyStar *aystar, AyStarNode *current, OpenListNode *parent);
|
||||
|
||||
/**
|
||||
* This function requests the tiles around the current tile and put them in #tiles_around.
|
||||
* #tiles_around is never reset, so if you are not using directions, just leave it alone.
|
||||
* \warning Never add more tiles_around than memory allocated for it.
|
||||
* This function requests the tiles around the current tile and put them in #neighbours.
|
||||
* #neighbours is never reset, so if you are not using directions, just leave it alone.
|
||||
* @warning Never add more #neighbours than memory allocated for it.
|
||||
*/
|
||||
typedef void AyStar_GetNeighbours(AyStar *aystar, OpenListNode *current);
|
||||
|
||||
|
@@ -155,6 +155,7 @@ static uint FindShipTrack(const Ship *v, TileIndex tile, DiagDirection dir, Trac
|
||||
|
||||
Track best_track = INVALID_TRACK;
|
||||
|
||||
assert(bits != TRACK_BIT_NONE);
|
||||
do {
|
||||
Track i = RemoveFirstTrack(&bits);
|
||||
|
||||
@@ -186,7 +187,7 @@ good:;
|
||||
best_length = pfs.best_length;
|
||||
bad:;
|
||||
|
||||
} while (bits != 0);
|
||||
} while (bits != TRACK_BIT_NONE);
|
||||
|
||||
*track = best_track;
|
||||
return best_bird_dist;
|
||||
|
@@ -25,7 +25,7 @@ template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_>
|
||||
class CNodeList_HashTableT {
|
||||
public:
|
||||
typedef Titem_ Titem; ///< Make #Titem_ visible from outside of class.
|
||||
typedef typename Titem_::Key Key; ///< Make Titem_::Key a property of #HashTable.
|
||||
typedef typename Titem_::Key Key; ///< Make Titem_::Key a property of this class.
|
||||
typedef SmallArray<Titem_, 65536, 256> CItemArray; ///< Type that we will use as item container.
|
||||
typedef CHashTableT<Titem_, Thash_bits_open_ > COpenList; ///< How pointers to open nodes will be stored.
|
||||
typedef CHashTableT<Titem_, Thash_bits_closed_> CClosedList; ///< How pointers to closed nodes will be stored.
|
||||
|
@@ -59,6 +59,8 @@ template <typename Tpf> void DumpState(Tpf &pf1, Tpf &pf2)
|
||||
FILE *f1 = fopen("yapf1.txt", "wt");
|
||||
FILE *f2 = fopen("yapf2.txt", "wt");
|
||||
#endif
|
||||
assert(f1 != NULL);
|
||||
assert(f2 != NULL);
|
||||
fwrite(dmp1.m_out.Data(), 1, dmp1.m_out.Size(), f1);
|
||||
fwrite(dmp2.m_out.Data(), 1, dmp2.m_out.Size(), f2);
|
||||
fclose(f1);
|
||||
|
Reference in New Issue
Block a user