diff options
author | maedhros <maedhros@openttd.org> | 2007-10-14 21:20:12 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-10-14 21:20:12 +0000 |
commit | 675a826601e74390673317bfbbada37dc8d57ec2 (patch) | |
tree | e736c50ab51b5772162a0b2e2bdc1fdc07aae36d /src/newgrf.cpp | |
parent | 42761739228fea45f3c561327cae3c609c4f34a1 (diff) | |
download | openttd-675a826601e74390673317bfbbada37dc8d57ec2.tar.xz |
(svn r11265) -Feature: Make more advanced rail types more expensive to build.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 8eb545412..769829158 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4192,8 +4192,19 @@ static void ParamSet(byte *buf, int len) _traininfo_vehicle_pitch = res; break; - /* @todo implement */ case 0x8F: // Rail track type cost factors + _railtype_cost_multiplier[0] = GB(res, 0, 8); + if (_patches.disable_elrails) { + _railtype_cost_multiplier[1] = GB(res, 0, 8); + _railtype_cost_multiplier[2] = GB(res, 8, 8); + } else { + _railtype_cost_multiplier[1] = GB(res, 8, 8); + _railtype_cost_multiplier[2] = GB(res, 16, 8); + } + _railtype_cost_multiplier[3] = GB(res, 16, 8); + break; + + /* @todo implement */ case 0x93: // Tile refresh offset to left case 0x94: // Tile refresh offset to right case 0x95: // Tile refresh offset upwards @@ -4696,7 +4707,7 @@ static void InitializeGRFSpecial() | (1 << 0x19) // newships | (1 << 0x1A) // newplanes | ((_patches.signal_side ? 1 : 0) << 0x1B) // signalsontrafficside - | (1 << 0x1C); // electrifiedrailway + | ((_patches.disable_elrails ? 0 : 1) << 0x1C); // electrifiedrailway _ttdpatch_flags[2] = (1 << 0x01) // loadallgraphics - obsolote | (1 << 0x03) // semaphores @@ -4708,7 +4719,7 @@ static void InitializeGRFSpecial() | (0 << 0x10) // moreindustriesperclimate - obsolete | (0 << 0x11) // moretoylandfeatures | (1 << 0x12) // newstations - | (0 << 0x13) // tracktypecostdiff + | (1 << 0x13) // tracktypecostdiff | (1 << 0x14) // manualconvert | ((_patches.build_on_slopes ? 1 : 0) << 0x15) // buildoncoasts | (1 << 0x16) // canals @@ -4968,6 +4979,9 @@ static void ResetNewGRFData() _traininfo_vehicle_pitch = 0; _traininfo_vehicle_width = 29; + /* Reset track cost multipliers. */ + memcpy(&_railtype_cost_multiplier, &_default_railtype_cost_multiplier, sizeof(_default_railtype_cost_multiplier)); + _loaded_newgrf_features.has_2CC = false; _loaded_newgrf_features.has_newhouses = false; _loaded_newgrf_features.has_newindustries = false; |