diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp index ba2f6c1b926..750e11f314c 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp +++ b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp @@ -781,7 +781,9 @@ int CLuaPedDefs::IsPedInVehicle(lua_State* luaVM) if (!argStream.HasErrors()) { - lua_pushboolean(luaVM, CStaticFunctionDefinitions::GetPedOccupiedVehicle(pPed) != NULL); + CVehicle* vehicle = CStaticFunctionDefinitions::GetPedOccupiedVehicle(pPed); + bool inVehicle = vehicle && pPed->GetVehicleAction() == CPed::VEHICLEACTION_NONE; + lua_pushboolean(luaVM, inVehicle); return 1; } else