mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-24 12:44:10 +01:00
(svn r13200) [0.6] -Backport from trunk (r13023, r13066, r13074, r13137):
- Fix: Do not send rcon commands of the server to the first client but do directly execute those on the server (r13137) - Fix: For multiheaded engines, halve power and running cost when used instead of when loading, to allow callback values to work properly (r13074) - Fix: Loading of TTDP savegames with rivers in them [FS#2005] (r13066) - Fix: Revert changes to multihead engine weight -- the original values were correct (r13023)
This commit is contained in:
@@ -374,22 +374,14 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
||||
rvi->max_speed = speed;
|
||||
} break;
|
||||
|
||||
case 0x0B: { // Power
|
||||
uint16 power = grf_load_word(&buf);
|
||||
case 0x0B: // Power
|
||||
rvi->power = grf_load_word(&buf);
|
||||
dewagonize(rvi->power, engine + i);
|
||||
break;
|
||||
|
||||
if (rvi->railveh_type == RAILVEH_MULTIHEAD) power /= 2;
|
||||
|
||||
rvi->power = power;
|
||||
dewagonize(power, engine + i);
|
||||
} break;
|
||||
|
||||
case 0x0D: { // Running cost factor
|
||||
uint8 runcostfact = grf_load_byte(&buf);
|
||||
|
||||
if (rvi->railveh_type == RAILVEH_MULTIHEAD) runcostfact /= 2;
|
||||
|
||||
rvi->running_cost = runcostfact;
|
||||
} break;
|
||||
case 0x0D: // Running cost factor
|
||||
rvi->running_cost = grf_load_byte(&buf);
|
||||
break;
|
||||
|
||||
case 0x0E: { // Running cost base
|
||||
uint32 base = grf_load_dword(&buf);
|
||||
@@ -421,18 +413,8 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
||||
uint8 dual = grf_load_byte(&buf);
|
||||
|
||||
if (dual != 0) {
|
||||
if (rvi->railveh_type != RAILVEH_MULTIHEAD) {
|
||||
// adjust power and running cost if needed
|
||||
rvi->power /= 2;
|
||||
rvi->running_cost /= 2;
|
||||
}
|
||||
rvi->railveh_type = RAILVEH_MULTIHEAD;
|
||||
} else {
|
||||
if (rvi->railveh_type == RAILVEH_MULTIHEAD) {
|
||||
// adjust power and running cost if needed
|
||||
rvi->power *= 2;
|
||||
rvi->running_cost *= 2;
|
||||
}
|
||||
rvi->railveh_type = rvi->power == 0 ?
|
||||
RAILVEH_WAGON : RAILVEH_SINGLEHEAD;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user