View Issue Details

IDProjectCategoryView StatusLast Update
0005444Multi Theft Auto : San AndreasServerpublic2010-10-21 17:57
ReporterKaylAssigned ToGamesnert 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformPC 32 bitsOSWindowsOS VersionVista
Product Version 
Target Version1.0.4Fixed in Version1.0.4 
Summary0005444: getVehicleOccupants crashes the side it's called on when used on a truck trailer or any train
Description

The newly introduced function getVehicleOccupants makes the side it's called on stop responding when used on truck trailers or any train model.

When it's called serverside, server won't respond and clients get Network trouble, even if server doesn't crash.

When it's called clientside, client MTA becomes dead and doesn't respond.

Steps To Reproduce

function serverbugCmd(player)
local x, y, z = getElementPosition(player)
local vehicle = createVehicle(435, x+2, y+2, z)
getVehicleOccupants(vehicle)
end
addCommandHandler("sbug", serverbugCmd)

function clientbugCmd()
local x, y, z = getElementPosition(getLocalPlayer())
local vehicle = createVehicle(435, x+2, y+2, z)
getVehicleOccupants(vehicle)
end
addCommandHandler("cbug", clientbugCmd)

Additional Information

For now to overcome this, simply add this BEFORE the code that uses getVehicleOccupants

The "or 0" is vital since getVehicleMaxPassengers(vehicle) fails to return 0 on the exact vehicles getVehicleOccupants is failing

function getVehicleOccupants(vehicle)
local occupants = {}
local maxPassengers = getVehicleMaxPassengers(vehicle) or 0
for seat=0,maxPassengers do
local occupant = getVehicleOccupant(vehicle, seat)
if occupant then
occupants[seat] = occupant
end
end
return occupants
end

TagsNo tags attached.

Activities

Kayl

2010-09-21 09:21

developer   ~~0011990

Isn't that fixed by r1993 and r2001?

Issue History

Date Modified Username Field Change