mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-15 18:49:10 +00:00
(svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans - Reduce variable scope - Bracing - Use DeMorgan's law to make conditionals easier to read - if cascade -> switch - Replace some magic numbers by symbolic names - Avoid assignments within other statements
This commit is contained in:
@@ -44,9 +44,7 @@ static void TrainCargoChanged(Vehicle* v)
|
||||
|
||||
for (u = v; u != NULL; u = u->next) {
|
||||
const RailVehicleInfo *rvi = RailVehInfo(u->engine_type);
|
||||
uint16 vweight = 0;
|
||||
|
||||
vweight += (_cargoc.weights[u->cargo_type] * u->cargo_count) / 16;
|
||||
uint16 vweight = (_cargoc.weights[u->cargo_type] * u->cargo_count) / 16;
|
||||
|
||||
// Vehicle weight is not added for articulated parts.
|
||||
if (!IsArticulatedPart(u)) {
|
||||
|
Reference in New Issue
Block a user