mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r2400) - Fix: [newgrf] Load power for dual-headed engines correctly
This commit is contained in:
parent
922b9dd7f3
commit
6849e086f5
11
newgrf.c
11
newgrf.c
@ -225,6 +225,9 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
FOR_EACH_OBJECT {
|
FOR_EACH_OBJECT {
|
||||||
uint16 power = grf_load_word(&buf);
|
uint16 power = grf_load_word(&buf);
|
||||||
|
|
||||||
|
if (rvi[i].flags & RVI_MULTIHEAD)
|
||||||
|
power /= 2;
|
||||||
|
|
||||||
rvi[i].power = power;
|
rvi[i].power = power;
|
||||||
dewagonize(power, engine + i);
|
dewagonize(power, engine + i);
|
||||||
}
|
}
|
||||||
@ -269,9 +272,13 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
uint8 dual = grf_load_byte(&buf);
|
uint8 dual = grf_load_byte(&buf);
|
||||||
|
|
||||||
if (dual != 0) {
|
if (dual != 0) {
|
||||||
rvi[i].flags |= 1;
|
if (!(rvi[i].flags & RVI_MULTIHEAD)) // adjust power if needed
|
||||||
|
rvi[i].power /= 2;
|
||||||
|
rvi[i].flags |= RVI_MULTIHEAD;
|
||||||
} else {
|
} else {
|
||||||
rvi[i].flags &= ~1;
|
if (rvi[i].flags & RVI_MULTIHEAD) // adjust power if needed
|
||||||
|
rvi[i].power *= 2;
|
||||||
|
rvi[i].flags &= ~RVI_MULTIHEAD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
Loading…
Reference in New Issue
Block a user