mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 01:12:39 +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:
@@ -114,6 +114,9 @@ void TrainPowerChanged(Vehicle* v)
|
||||
if (engine_has_power) {
|
||||
uint16 power = GetVehicleProperty(u, 0x0B, rvi_u->power);
|
||||
if (power != 0) {
|
||||
/* Halve power for multiheaded parts */
|
||||
if (IsMultiheaded(u)) power /= 2;
|
||||
|
||||
total_power += power;
|
||||
/* Tractive effort in (tonnes * 1000 * 10 =) N */
|
||||
max_te += (u->u.rail.cached_veh_weight * 10000 * GetVehicleProperty(u, 0x1F, rvi_u->tractive_effort)) / 256;
|
||||
@@ -3633,6 +3636,9 @@ Money Train::GetRunningCost() const
|
||||
byte cost_factor = GetVehicleProperty(v, 0x0D, rvi->running_cost);
|
||||
if (cost_factor == 0) continue;
|
||||
|
||||
/* Halve running cost for multiheaded parts */
|
||||
if (IsMultiheaded(v)) cost_factor /= 2;
|
||||
|
||||
cost += cost_factor * GetPriceByIndex(rvi->running_cost_class);
|
||||
} while ((v = GetNextVehicle(v)) != NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user