View Issue Details

IDProjectCategoryView StatusLast Update
0005145Multi Theft Auto : San AndreasServerpublic2010-01-09 02:52
ReporterKaylAssigned Toccw 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformPC 32bitsOSWindowsOS VersionVista
Product Version 
Target Version1.0.4Fixed in Version1.0.4 
Summary0005145: createMarker crashes the server if called within a collision event handler
Description

When attempting to create a marker within an onColShapeLeave event handler, the marker is created (visible by the client) but the server crashes right away with no warning or log message.

I have summarized below the minimum code to reproduce it (server side script).
Deleting or not the colSphere has no impact, the problem is the createMarker. If it is replaced by a createPed for instance it works fine.

Steps To Reproduce

g_Root = getRootElement()
g_ResRoot = getResourceRootElement(getThisResource())

local g_CurrentVars = nil

function testCmd(player)
local x,y,z = getElementPosition(player)

local playerPos = {}
playerPos.x = x
playerPos.y = y
playerPos.z = z

g_CurrentVars = {}
g_CurrentVars.colSphere = createColSphere ( x,y,z, 5 )
g_CurrentVars.pos = playerPos

createMarker(g_CurrentVars.pos.x,g_CurrentVars.pos.y,g_CurrentVars.pos.z+1,"arrow",1)

addEventHandler("onColShapeLeave",g_CurrentVars.colSphere,onPlayerLeaveSphere)

end
addCommandHandler("test",testCmd)

function onPlayerLeaveSphere()
outputChatBox("onPlayerLeaveSphere")

createMarker(g_CurrentVars.pos.x,g_CurrentVars.pos.y,g_CurrentVars.pos.z+3,"arrow",1)

destroyElement(g_CurrentVars.colSphere)
g_CurrentVars.colSphere = nil

g_CurrentVars = nil

end

Additional Information

The bug doesn't seem to exist on the Linux server.

TagsNo tags attached.

Activities

Kayl

2009-12-23 00:45

developer   ~~0010904

I failed to mention (even if it's implied by the version number reported) that it worked fine with previous windows server versions (< 1.0.3)

Kayl

2010-01-08 16:20

developer   ~~0010940

Last edited: 2010-01-08 17:03

Nobody cares? It's quite annoying not to be able to use event-based marker creation.

Edit: workaround so far, do all the stuff that should be done in the onHit or onLeave in a function called with a setTimer(...,50).

Kayl

2010-01-08 23:08

developer   ~~0010952

Bug now confirmed also on 1.0.3 Linux server.
The setTimer workaround is the only way to make it work on both OSs.

ccw

2010-01-09 02:51

administrator   ~~0010959

Thanks for the detailed report.

Fixed in http://github.com/ccw808/multitheftauto/commit/d9011e425f4773b8312c5f8d4f9cf8eabfb647f9

Issue History

Date Modified Username Field Change