summaryrefslogtreecommitdiff
path: root/src/ship.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-29 21:27:16 +0000
committerrubidium <rubidium@openttd.org>2007-08-29 21:27:16 +0000
commitdc8019575404425b52abc121c6bd9159596fee87 (patch)
treec750fba2dc3e7efcc74cbccf329c29e874b3102e /src/ship.h
parentfff12fd22e6e526c7a8259606bb9235f1ed97e06 (diff)
downloadopenttd-dc8019575404425b52abc121c6bd9159596fee87.tar.xz
(svn r10999) -Codechange: unify the way the running cost of a vehicle is determined. Patch by nycom.
Diffstat (limited to 'src/ship.h')
-rw-r--r--src/ship.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ship.h b/src/ship.h
index ac86c907a..929eeccc6 100644
--- a/src/ship.h
+++ b/src/ship.h
@@ -6,6 +6,8 @@
#define SHIP_H
#include "vehicle.h"
+#include "engine.h"
+#include "variables.h"
void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
void RecalcShipStuff(Vehicle *v);
@@ -48,6 +50,7 @@ struct Ship: public Vehicle {
int GetImage(Direction direction) const;
int GetDisplaySpeed() const { return this->cur_speed * 10 / 32; }
int GetDisplayMaxSpeed() const { return this->max_speed * 10 / 32; }
+ Money GetRunningCost() const { return ShipVehInfo(this->engine_type)->running_cost * _price.ship_running; }
void Tick();
};