Skip to content

Commit

Permalink
GetNWInt returns 0 despite having nil as default, compensate
Browse files Browse the repository at this point in the history
  • Loading branch information
ZehMatt committed Jun 23, 2024
1 parent 263600c commit f793e98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gamemode/sh_vehicles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,11 @@ function GM:VehicleGetType(vehicle)
end

if vehicle:GetNWBool("IsPassengerSeat", false) then return VEHICLE_PASSENGER end
return vehicle:GetNWInt("LambdaVehicleType", nil)
local res = vehicle:GetNWInt("LambdaVehicleType", -1)
if res == -1 then
return nil
end
return res
end

function GM:VehicleIsPassengerSeat(vehicle)
Expand Down

0 comments on commit f793e98

Please sign in to comment.