diff options
author | tron <tron@openttd.org> | 2005-01-22 22:47:58 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-22 22:47:58 +0000 |
commit | e5cd6b61933537888b1be19af437415861cca57f (patch) | |
tree | 078e42c5f2a6e1d8ef465541334a5c00039419e1 /ai_pathfinder.c | |
parent | e75c48ec7a8920c475e515fa13c7629f19cf1a14 (diff) | |
download | openttd-e5cd6b61933537888b1be19af437415861cca57f.tar.xz |
(svn r1596) Add some more statics
Diffstat (limited to 'ai_pathfinder.c')
-rw-r--r-- | ai_pathfinder.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ai_pathfinder.c b/ai_pathfinder.c index 81300e070..5c05879ad 100644 --- a/ai_pathfinder.c +++ b/ai_pathfinder.c @@ -8,7 +8,8 @@ // Tests if a station can be build on the given spot // TODO: make it train compatible -bool TestCanBuildStationHere(uint tile, byte dir) { +static bool TestCanBuildStationHere(uint tile, byte dir) +{ Player *p = DEREF_PLAYER(_current_player); if (dir == TEST_STATION_NO_DIR) { // TODO: currently we only allow spots that can be access from al 4 directions... @@ -46,7 +47,8 @@ static bool IsRoad(TileIndex tile) #define TILES_BETWEEN(a, b, c) (TileX(a) >= TileX(b) && TileX(a) <= TileX(c) && TileY(a) >= TileY(b) && TileY(a) <= TileY(c)) // Check if the current tile is in our end-area -int32 AyStar_AiPathFinder_EndNodeCheck(AyStar *aystar, OpenListNode *current) { +static int32 AyStar_AiPathFinder_EndNodeCheck(AyStar *aystar, OpenListNode *current) +{ Ai_PathFinderInfo *PathFinderInfo = (Ai_PathFinderInfo*)aystar->user_target; // It is not allowed to have a station on the end of a bridge or tunnel ;) if (current->path.node.user_data[0] != 0) return AYSTAR_DONE; @@ -60,12 +62,14 @@ int32 AyStar_AiPathFinder_EndNodeCheck(AyStar *aystar, OpenListNode *current) { // Calculates the hash // Currently it is a 10 bit hash, so the hash array has a max depth of 6 bits (so 64) -uint AiPathFinder_Hash(uint key1, uint key2) { +static uint AiPathFinder_Hash(uint key1, uint key2) +{ return (TileX(key1) & 0x1F) + ((TileY(key1) & 0x1F) << 5); } // Clear the memory of all the things -void AyStar_AiPathFinder_Free(AyStar *aystar) { +static void AyStar_AiPathFinder_Free(AyStar *aystar) +{ AyStarMain_Free(aystar); free(aystar); } |