File diff r24596:eddf98238034 → r24597:afde5721a3b6
src/newgrf_engine.cpp
Show inline comments
 
@@ -940,8 +940,8 @@ static uint32 VehicleGetVariable(Vehicle
 

	
 
	if (totalsets == 0) return nullptr;
 

	
 
	uint set = (v->cargo.StoredCount() * totalsets) / max((uint16)1, v->cargo_cap);
 
	set = min(set, totalsets - 1);
 
	uint set = (v->cargo.StoredCount() * totalsets) / std::max<uint16>(1u, v->cargo_cap);
 
	set = std::min(set, totalsets - 1);
 

	
 
	return in_motion ? group->loaded[set] : group->loading[set];
 
}