diff options
author | truelight <truelight@openttd.org> | 2005-02-06 10:18:47 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2005-02-06 10:18:47 +0000 |
commit | e9c93f9c0ca76117ac1315b6aff03f1f138f62e4 (patch) | |
tree | 0b6bfe4dfd7abf3e94d0f7210b1b842e429c4a02 /rail_cmd.c | |
parent | 6493e12bfbb147e41fc0f533bb3618b2931fed1f (diff) | |
download | openttd-e9c93f9c0ca76117ac1315b6aff03f1f138f62e4.tar.xz |
(svn r1817) -Codechange: Moved depot-functions to depot.c
-Codechange: Added wrappers around depot-access (GetDepot no exists)
-Codechange: Made depot-functions a bit more logic (no longer
GetDepotByTile crashes your game when you request it on a non-depot tile)
-Add: made depots dynamic (yes, 64k depots are possible now)
Diffstat (limited to 'rail_cmd.c')
-rw-r--r-- | rail_cmd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index 20827b0fb..7de16d0fb 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -12,6 +12,7 @@ #include "sound.h" #include "station.h" #include "sprite.h" +#include "depot.h" extern uint16 _custom_sprites_base; @@ -632,7 +633,7 @@ int32 CmdBuildTrainDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2) { uint tile = TILE_FROM_XY(x,y); int32 cost, ret; - Depot *dep; + Depot *depot; uint tileh; SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); @@ -649,8 +650,8 @@ int32 CmdBuildTrainDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2) if (ret == CMD_ERROR) return CMD_ERROR; cost = ret; - dep = AllocateDepot(); - if (dep == NULL) + depot = AllocateDepot(); + if (depot == NULL) return CMD_ERROR; if (flags & DC_EXEC) { @@ -664,8 +665,8 @@ int32 CmdBuildTrainDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2) p2 | RAIL_TYPE_DEPOT /* map5 */ ); - dep->xy = tile; - dep->town_index = ClosestTownFromTile(tile, (uint)-1)->index; + depot->xy = tile; + depot->town_index = ClosestTownFromTile(tile, (uint)-1)->index; SetSignalsOnBothDir(tile, (p2&1) ? 2 : 1); |