mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-04 13:15:48 +01:00
Fix cp1250 decoding, log unsupported loads
The repositories resolved GetEncoding(1250) in their constructors, before anything registered CodePagesEncodingProvider - reads fell back to Latin-1 and Polish characters came out as mojibake.
This commit is contained in:
@@ -169,11 +169,17 @@ public static class TrainsetDisplay
|
||||
if (p != null)
|
||||
massKg += p.Mass;
|
||||
|
||||
if (loadWeightKg != null &&
|
||||
car.LoadCount > 0 &&
|
||||
!string.IsNullOrEmpty(car.LoadType) &&
|
||||
LoadAccepted(p, car.LoadType))
|
||||
loadKg += (double)car.LoadCount * loadWeightKg(car.LoadType);
|
||||
if (loadWeightKg != null && car.LoadCount > 0 && !string.IsNullOrEmpty(car.LoadType))
|
||||
{
|
||||
if (LoadAccepted(p, car.LoadType))
|
||||
loadKg += (double)car.LoadCount * loadWeightKg(car.LoadType);
|
||||
else
|
||||
// The scenery loads something this vehicle's .fiz does not
|
||||
// accept. It is left out of the gross mass, and saying so beats
|
||||
// leaving the reading quietly short.
|
||||
AppServices.Current.Log.Log(
|
||||
$"{car.Name}: nieobslugiwany ladunek \"{car.LoadType}\"");
|
||||
}
|
||||
}
|
||||
return (lengthM, massKg, loadKg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user