|
@@ -2,25 +2,25 @@
|
|
|
#include "openttd.h"
|
|
|
#include "debug.h"
|
|
|
#include "map.h"
|
|
|
#include "tile.h"
|
|
|
#include "command.h"
|
|
|
#include "ai.h"
|
|
|
#include "depot.h"
|
|
|
|
|
|
#define TEST_STATION_NO_DIR 0xFF
|
|
|
|
|
|
// Tests if a station can be build on the given spot
|
|
|
// TODO: make it train compatible
|
|
|
static bool TestCanBuildStationHere(uint tile, byte dir)
|
|
|
static bool TestCanBuildStationHere(TileIndex tile, byte dir)
|
|
|
{
|
|
|
Player *p = GetPlayer(_current_player);
|
|
|
|
|
|
if (dir == TEST_STATION_NO_DIR) {
|
|
|
int32 ret;
|
|
|
// TODO: currently we only allow spots that can be access from al 4 directions...
|
|
|
// should be fixed!!!
|
|
|
for (dir = 0; dir < 4; dir++) {
|
|
|
ret = AiNew_Build_Station(p, p->ainew.tbt, tile, 1, 1, dir, DC_QUERY_COST);
|
|
|
if (!CmdFailed(ret)) return true;
|
|
|
}
|
|
|
return false;
|