View Issue Details

IDProjectCategoryView StatusLast Update
0008310Multi Theft Auto : San AndreasServerpublic2014-07-05 13:39
ReporterarranTunaAssigned Tosbx320 
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version 
Target Version1.4Fixed in Version1.4 
Summary0008310: getPedOccupiedVehicle sometimes returns invalid element
Description

Like #8252 but for getPedOccupiedVehicle.

Steps To Reproduce

Do this a few times on a busy server:

function getVeh()
for i, plr in ipairs(getElementsByType("player")) do
local veh = getPedOccupiedVehicle(plr)
if (veh and not isElement(veh)) then
outputDebugString("Veh but not element: "..tostring(veh))
end
end
end
setTimer(getVeh, 100, 10)

And you'll get something like:

Veh but not element: userdata: 3319B558 ([string "function getVeh()..."]:nil)
Veh but not element: userdata: 3319B558 ([string "function getVeh()..."]:nil)

TagsNo tags attached.

Activities

sbx320

2014-07-03 03:32

administrator   ~~0021223

Alright, my initial assumptions were totally wrong. My previous changes prevented getVehicleOccupant(s) returning an invalid player element.

However this occurs when a vehicle element was deleted in the same server frame. This probably affects the client just in the same way.

Furthermore I found a simple way to reproduce this issue:
http://pastebin.com/jULd9nV4

I feel like the current approach isn't the best. Looking into a new approach now.

sbx320

2014-07-04 04:09

administrator   ~~0021235

Retest with http://code.google.com/p/mtasa-blue/source/detail?r=6638 please.

arranTuna

2014-07-05 13:38

manager   ~~0021241

No longer getting any debug warnings

Issue History

Date Modified Username Field Change