summaryrefslogtreecommitdiff
path: root/npf.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-13 21:15:00 +0000
committertron <tron@openttd.org>2006-02-13 21:15:00 +0000
commitea73b466844a048f9f55b933f243ec19bdaaa18c (patch)
tree19340b96ef341c9784a27b719a1a90c2c691ca56 /npf.c
parent235e72829e55cbb1e7632fe1b2d1429f6f3be054 (diff)
downloadopenttd-ea73b466844a048f9f55b933f243ec19bdaaa18c.tar.xz
(svn r3597) Miscellaneous (I like that word) changes: Fix some indentation, add consts, reduce indentation level by short-circuit logic, convert if cascades to switch, whitespace, bracing, plus some minor stuff
Diffstat (limited to 'npf.c')
-rw-r--r--npf.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/npf.c b/npf.c
index ad0fbccbd..2285af1c4 100644
--- a/npf.c
+++ b/npf.c
@@ -208,25 +208,26 @@ static void NPFMarkTile(TileIndex tile)
#ifdef NO_DEBUG_MESSAGES
return;
#else
- if (_debug_npf_level >= 1)
- switch (GetTileType(tile)) {
- case MP_RAILWAY:
- /* DEBUG: mark visited tiles by mowing the grass under them
- * ;-) */
- if (!IsTileDepotType(tile, TRANSPORT_RAIL)) {
- SB(_m[tile].m2, 0, 4, 0);
- MarkTileDirtyByTile(tile);
- }
- break;
- case MP_STREET:
- if (!IsTileDepotType(tile, TRANSPORT_ROAD)) {
- SB(_m[tile].m4, 4, 3, 0);
- MarkTileDirtyByTile(tile);
- }
- break;
- default:
- break;
- }
+ if (_debug_npf_level < 1) return;
+ switch (GetTileType(tile)) {
+ case MP_RAILWAY:
+ /* DEBUG: mark visited tiles by mowing the grass under them ;-) */
+ if (!IsTileDepotType(tile, TRANSPORT_RAIL)) {
+ SB(_m[tile].m2, 0, 4, 0);
+ MarkTileDirtyByTile(tile);
+ }
+ break;
+
+ case MP_STREET:
+ if (!IsTileDepotType(tile, TRANSPORT_ROAD)) {
+ SB(_m[tile].m4, 4, 3, 0);
+ MarkTileDirtyByTile(tile);
+ }
+ break;
+
+ default:
+ break;
+ }
#endif
}
@@ -298,7 +299,7 @@ static int32 NPFRailPathCost(AyStar* as, AyStarNode* current, OpenListNode* pare
TileIndex tile = current->tile;
Trackdir trackdir = (Trackdir)current->direction;
int32 cost = 0;
- /* HACK: We create a OpenListNode manualy, so we can call EndNodeCheck */
+ /* HACK: We create a OpenListNode manually, so we can call EndNodeCheck */
OpenListNode new_node;
/* Determine base length */