autoslope.h

Go to the documentation of this file.
00001 /* $Id: autoslope.h 11818 2008-01-12 14:10:35Z rubidium $ */
00002 
00005 #ifndef AUTOSLOPE_H
00006 #define AUTOSLOPE_H
00007 
00008 #include "depot.h"
00009 #include "settings_type.h"
00010 #include "player_func.h"
00011 
00026 static inline bool AutoslopeCheckForEntranceEdge(TileIndex tile, uint z_new, Slope tileh_new, DiagDirection entrance)
00027 {
00028   if (IsSteepSlope(tileh_new) || (GetTileMaxZ(tile) != z_new + GetSlopeMaxZ(tileh_new))) return false;
00029   return ((tileh_new == SLOPE_FLAT) || CanBuildDepotByTileh(entrance, tileh_new));
00030 }
00031 
00039 static inline bool AutoslopeEnabled()
00040 {
00041   return (_patches.autoslope &&
00042           ((IsValidPlayer(_current_player) && !_is_old_ai_player) ||
00043            (_current_player == OWNER_NONE && _game_mode == GM_EDITOR)));
00044 }
00045 
00046 #endif /* AUTOSLOPE_H */

Generated on Mon Sep 22 20:34:14 2008 for openttd by  doxygen 1.5.6