diff options
author | darkvater <darkvater@openttd.org> | 2005-01-04 17:11:03 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2005-01-04 17:11:03 +0000 |
commit | fc52b512aa6f01c26685b5690b79c138e9df1a34 (patch) | |
tree | d267ed7e6b75716dae1f804e1b9c49b3778e3f61 /train_cmd.c | |
parent | 9d38a7afca901af3d6014abd73d66545fdb8965c (diff) | |
download | openttd-fc52b512aa6f01c26685b5690b79c138e9df1a34.tar.xz |
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c index 45f34285a..63d541338 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -231,6 +231,8 @@ static int32 CmdBuildRailWagon(uint engine, uint tile, uint32 flags) const Engine *e; int x,y; + SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES); + rvi = RailVehInfo(engine); value = (rvi->base_cost * _price.build_railwagon) >> 8; @@ -1069,7 +1071,7 @@ int32 CmdRefitRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) p2 = p2 & 0xFF; - SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES); + SET_EXPENSES_TYPE(EXPENSES_TRAIN_RUN); v = &_vehicles[p1]; if (!CheckOwnership(v->owner) || ((CheckStoppedInDepot(v) < 0) && !(SkipStoppedInDepotCheck))) |