fix(fuel): fixed currentFuel nil error

This commit is contained in:
No.1 committed 2025-06-08 19:40:01 +03:00
1 parent 63c644d277
commit 09d968a521
1 file changed
+1 -1
+1 -1
View File
@@ -24,7 +24,7 @@ end
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
local currentFuel = Entity(vehicle).state.fuel
Entity(vehicle).state.fuel = currentFuel + fuel
Entity(vehicle).state.fuel = currentFuel and currentFuel + fuel or fuel
return Entity(vehicle).state.fuel
end