From 35ef197be48634ee3978ec5c4d14fb07c3ce4fd7 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Wed, 12 Mar 2025 20:42:17 +0100 Subject: [PATCH] Codefix: potential integer overflow before widening integer --- src/ground_vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index 97e21bafe1..ca8fe65fcf 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -110,7 +110,7 @@ int GroundVehicle::GetAcceleration() const int64_t speed = v->GetCurrentSpeed(); // [km/h-ish] /* Weight is stored in tonnes. */ - int32_t mass = this->gcache.cached_weight; + int64_t mass = this->gcache.cached_weight; /* Power is stored in HP, we need it in watts. * Each vehicle can have U16 power, 128 vehicles, HP -> watt