Merge pull request #113 from harbiyelidev/dev

fix(fuel): fixed currentFuel nil error
This commit is contained in:
MrNewb authored and GitHub committed 2025-06-08 16:30:09 -04:00
commit 71aca51cb5
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