From 97f893ae2f262fc0521b785b8cf73661f1ce6f95 Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 22 Jan 2005 22:47:58 +0000 Subject: (svn r1596) Add some more statics --- ai_pathfinder.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ai_pathfinder.c') 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); } -- cgit v1.2.3-54-g00ecf