summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-04 15:12:30 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-04 15:12:30 +0000
commitc8ecaaddeee46900540e24e096f86306e77493f7 (patch)
tree9343198cebf2d0c17638b21704d0f39973b9c321
parentRailVehicleClass texture might be null (diff)
downloadilt-c8ecaaddeee46900540e24e096f86306e77493f7.tar.bz2
ilt-c8ecaaddeee46900540e24e096f86306e77493f7.tar.xz
ilt-c8ecaaddeee46900540e24e096f86306e77493f7.zip
Load length, wheelBase and maxSpeed RailVehicleClass properties from XML
Adjusts bogie position to appear correct according to wheelBase
-rw-r--r--game/vehicles/railVehicleClass.cpp3
-rw-r--r--res/brush47.xml6
2 files changed, 5 insertions, 4 deletions
diff --git a/game/vehicles/railVehicleClass.cpp b/game/vehicles/railVehicleClass.cpp
index c0740cc..90a06bd 100644
--- a/game/vehicles/railVehicleClass.cpp
+++ b/game/vehicles/railVehicleClass.cpp
@@ -44,7 +44,8 @@ RailVehicleClass::RailVehicleClass() { }
bool
RailVehicleClass::persist(Persistence::PersistenceStore & store)
{
- return STORE_TYPE && STORE_MEMBER(maxSpeed) && STORE_NAME_HELPER("bogie", bogies, Asset::MeshArrayConstruct)
+ return STORE_TYPE && STORE_MEMBER(length) && STORE_MEMBER(wheelBase) && STORE_MEMBER(maxSpeed)
+ && STORE_NAME_HELPER("bogie", bogies, Asset::MeshArrayConstruct)
&& STORE_HELPER(bodyMesh, Asset::MeshConstruct) && Asset::persist(store);
}
diff --git a/res/brush47.xml b/res/brush47.xml
index 796641a..9c7d2a8 100644
--- a/res/brush47.xml
+++ b/res/brush47.xml
@@ -12,7 +12,7 @@
<use type="axel" position="0,2,0"/>
<use type="axel" position="0,-2,0"/>
</object>
- <asset p.typeid="RailVehicleClass" id="brush-47" name="Brush 47">
+ <asset p.typeid="RailVehicleClass" id="brush-47" name="Brush 47" length="19.38" wheelBase="15.70" maxSpeed="42.4688">
<bodyMesh id="body" size="2.69,19.38,3.9">
<use type="cuboid" position="0,0,1.2" scale="2.69,19.38,1.5" colour="#2c4f5a">
<face id="bottom" colour="#2c3539"/>
@@ -27,10 +27,10 @@
<use type="cuboid" position="0,0,0.2" scale="2.6,4.5,1" colour="grey30"/>
</bodyMesh>
<bogie id="bogie1">
- <use type="bogie" position="0,6,0" colour="#413b3a"/>
+ <use type="bogie" position="0,-1.85,0" colour="#413b3a"/>
</bogie>
<bogie id="bogie2">
- <use type="bogie" position="0,-6,0" rotation="0,3.14159,0" colour="#413b3a"/>
+ <use type="bogie" position="0,1.85,0" rotation="0,3.14159,0" colour="#413b3a"/>
</bogie>
</asset>
</ilt>