00001 /* $Id: autoslope.h 14422 2008-09-30 20:51:04Z rubidium $ */ 00002 00005 #ifndef AUTOSLOPE_H 00006 #define AUTOSLOPE_H 00007 00008 #include "settings_type.h" 00009 #include "company_func.h" 00010 #include "depot_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 (_settings_game.construction.autoslope && 00042 ((_current_company < MAX_COMPANIES && !_is_old_ai_company) || 00043 (_current_company == OWNER_NONE && _game_mode == GM_EDITOR))); 00044 } 00045 00046 #endif /* AUTOSLOPE_H */
1.5.6