Changeset - r1753:dfb62f02dda8
[Not reviewed]
master
0 1 0
matthijs - 19 years ago 2005-05-03 00:11:30
matthijs@openttd.org
(svn r2257) - Fix: [NPF] NPF debug markings modify _map2 instead of _map3_hi for street tiles, corrupting them.
Some info got moved around in r1768 for street tiles, but NPF did not get updated.
1 file changed with 10 insertions and 3 deletions:
npf.c
10
3
0 comments (0 inline, 0 general)
npf.c
Show inline comments
 
@@ -250,29 +250,36 @@ uint NPFSlopeCost(AyStarNode* current) {
 
	 * could just substract that bonus from the penalty, because
 
	 * there is only one level of steepness... */
 
}
 

	
 
/* Mark tiles by mowing the grass when npf debug level >= 1 */
 
void NPFMarkTile(TileIndex tile) {
 
#ifdef NO_DEBUG_MESSAGES
 
	return;
 
#else
 
	if (_debug_npf_level >= 1)
 
		switch(GetTileType(tile)) {
 
			case MP_RAILWAY:
 
			case MP_STREET:
 
				/* DEBUG: mark visited tiles by mowing the grass under them
 
				 * ;-) */
 
				_map2[tile] &= ~15;
 
				MarkTileDirtyByTile(tile);
 
				if (!IsTileDepotType(tile, TRANSPORT_RAIL)) {
 
					_map2[tile] &= ~15; /* Clear bits 0-3 */
 
					MarkTileDirtyByTile(tile);
 
				}
 
				break;
 
			case MP_STREET:
 
				if (!IsTileDepotType(tile, TRANSPORT_ROAD)) {
 
					_map3_hi[tile] &= ~0x70; /* Clear bits 4-6 */
 
					MarkTileDirtyByTile(tile);
 
				}
 
				break;
 
			default:
 
				break;
 
		}
 
#endif
 
}
 

	
 
int32 NPFWaterPathCost(AyStar* as, AyStarNode* current, OpenListNode* parent) {
 
	//TileIndex tile = current->tile;
 
	int32 cost = 0;
 
	byte trackdir = current->direction;
 

	
0 comments (0 inline, 0 general)