summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-18 21:28:07 +0000
committerrubidium <rubidium@openttd.org>2011-01-18 21:28:07 +0000
commit6371b75bcc0789d4895e5c157237cbeaf332a99a (patch)
tree839d8ea502592470cb12a30a64eeb130dc62508a /src/newgrf.cpp
parent5f285916100bea2ee28ca3d8680f5bc2c99fa942 (diff)
downloadopenttd-6371b75bcc0789d4895e5c157237cbeaf332a99a.tar.xz
(svn r21841) -Feature: [NewGRF] Allow to define other railtypes that should be introduced if a particular rail type is introduced, e.g. to make sure slow rail is introduced when fast rail gets introduced
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 4a4f55213..4f3c23f2f 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -3209,6 +3209,7 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, ByteR
case 0x0E: // Compatible railtype list
case 0x0F: // Powered railtype list
+ case 0x19: // Introduced railtype list
{
/* Rail type compatibility bits are added to the existing bits
* to allow multiple GRFs to modify compatibility with the
@@ -3218,10 +3219,10 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, ByteR
RailTypeLabel label = buf->ReadDWord();
RailType rt = GetRailTypeByLabel(BSWAP32(label));
if (rt != INVALID_RAILTYPE) {
- if (prop == 0x0E) {
- SetBit(rti->compatible_railtypes, rt);
- } else {
- SetBit(rti->powered_railtypes, rt);
+ switch (prop) {
+ case 0x0E: SetBit(rti->compatible_railtypes, rt); break;
+ case 0x0F: SetBit(rti->powered_railtypes, rt); break;
+ case 0x19: SetBit(rti->introduces_railtypes, rt); break;
}
}
}
@@ -3303,6 +3304,7 @@ static ChangeInfoResult RailTypeReserveInfo(uint id, int numinfo, int prop, Byte
case 0x0E: // Compatible railtype list
case 0x0F: // Powered railtype list
+ case 0x19: // Introduced railtype list
for (int j = buf->ReadByte(); j != 0; j--) buf->ReadDWord();
break;