summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2012-11-10 20:45:04 +0000
committeralberth <alberth@openttd.org>2012-11-10 20:45:04 +0000
commit69e07c3e00180053cc087ceb1dfeb89845b79857 (patch)
tree5d6689768caf5afbafa1d3b7ff6063ca8f40ae24 /src/table
parente087503fd6cf8a461fac7a11bbd9a96f7b4180e7 (diff)
downloadopenttd-69e07c3e00180053cc087ceb1dfeb89845b79857.tar.xz
(svn r24691) -Codechange: Add resolver classes for vehicles.
Diffstat (limited to 'src/table')
-rw-r--r--src/table/newgrf_debug_data.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h
index 6ec8df40e..3cd9501d2 100644
--- a/src/table/newgrf_debug_data.h
+++ b/src/table/newgrf_debug_data.h
@@ -10,6 +10,7 @@
/** @file newgrf_debug_data.h Data 'tables' for NewGRF debugging. */
#include "../newgrf_house.h"
+#include "../newgrf_engine.h"
/* Helper for filling property tables */
#define NIP(prop, base, variable, type, name) { name, cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type }
@@ -69,7 +70,13 @@ class NIHVehicle : public NIHelper {
const void *GetSpec(uint index) const { return Vehicle::Get(index)->GetEngine(); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
uint32 GetGRFID(uint index) const { return Vehicle::Get(index)->GetGRFID(); }
- void Resolve(ResolverObject *ro, uint32 index) const { extern void GetVehicleResolver(ResolverObject *ro, uint index); GetVehicleResolver(ro, index); }
+
+ /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ {
+ Vehicle *v = Vehicle::Get(index);
+ VehicleResolverObject ro(v->engine_type, v);
+ return ro.GetScope(ro.scope)->GetVariable(var, param, avail);
+ }
};
static const NIFeature _nif_vehicle = {