summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-01 00:21:08 +0000
committerfrosch <frosch@openttd.org>2011-11-01 00:21:08 +0000
commit72cd855978bf45fd444eae72551a12e13a35b0c8 (patch)
treeb7f4b3cc07022ba32160f5e67f4cb5a527266d12 /src/table
parentc366e0d45f87f9ba625ed73cbf5bff61d8483c5c (diff)
downloadopenttd-72cd855978bf45fd444eae72551a12e13a35b0c8.tar.xz
(svn r23074) -Codechange: Add Vehicle::GetEngine() to simplify code.
Diffstat (limited to 'src/table')
-rw-r--r--src/table/newgrf_debug_data.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h
index 0faf2979b..e7867e3aa 100644
--- a/src/table/newgrf_debug_data.h
+++ b/src/table/newgrf_debug_data.h
@@ -61,12 +61,12 @@ static const NIVariable _niv_vehicles[] = {
};
class NIHVehicle : public NIHelper {
- bool IsInspectable(uint index) const { return Engine::Get(Vehicle::Get(index)->engine_type)->grf_prop.grffile != NULL; }
+ bool IsInspectable(uint index) const { return Vehicle::Get(index)->GetEngine()->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
const void *GetInstance(uint index)const { return Vehicle::Get(index); }
- const void *GetSpec(uint index) const { return Engine::Get(Vehicle::Get(index)->engine_type); }
+ 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 (this->IsInspectable(index)) ? Engine::Get(Vehicle::Get(index)->engine_type)->grf_prop.grffile->grfid : 0; }
+ uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? Vehicle::Get(index)->GetEngine()->grf_prop.grffile->grfid : 0; }
void Resolve(ResolverObject *ro, uint32 index) const { extern void GetVehicleResolver(ResolverObject *ro, uint index); GetVehicleResolver(ro, index); }
};