View Issue Details

IDProjectCategoryView StatusLast Update
0007442Multi Theft Auto : San AndreasClientpublic2012-12-16 11:49
ReporterarezuAssigned Toccw 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target Version1.3.2Fixed in Version1.3.2 
Summary0007442: Element is destroyed client sided when created and parent set in different resource than the parent
Description

Element is destroyed client sided when created and parent set in different resource than the parent (Only tested creating and setting parent server sided).

Steps To Reproduce

First test:
-- Resource "A" server sided
local parent = createElement("parentTest", "parentTest")
local child = createElement("childTest", "childTest")
setElementParent(child, parent)
child = getElementByID("childTest")
outputChatBox(getElementID(child)) -- outputs childTest in chatbox

-- Resource "A" client sided
local child = getElementByID("childTest")
outputChatBox(getElementID(child)) -- outputs childTest in chatbox

Second test:
-- Resource "A" server sided
local parent = createElement("parentTest", "parentTest")

-- Resource "B" server sided
local parent = getElementByID("parentTest")
local child = createElement("childTest", "childTest")
setElementParent(child, parent)
child = getElementByID("childTest")
outputChatBox(getElementID(child)) -- outputs childTest in chatbox

-- Resource "B" client sided
local child = getElementByID("childTest")
outputChatBox(getElementID(child)) -- error, element doesn't exist

TagsNo tags attached.

Activities

arezu

2012-12-15 20:27

viewer   ~~0017897

forgot to mention that trying to get the element client sided in second test in resource "A" would also return false.

ccw

2012-12-15 21:39

administrator   ~~0017898

I just tried and it worked OK for me.

Can you create some resources to demonstrate this issue?

arezu

2012-12-15 22:17

viewer   ~~0017899

Last edited: 2012-12-15 22:37

http://www.mediafire.com/?ujdzklwl1lfa86j
Start resource A and then B, and then write testA in console.
If you remove the setElementParent in resource "B", then the problem wont occur, So im sure thats the problem.

ccw

2012-12-15 23:27

administrator   ~~0017900

Thanks for that.

The bug is due to the new child element not being sent to the client.

A work around for now would be to delay setElementParent until after the resource has started. i.e. setTimer(setElementParent, 50, 1, child, parent)

arezu

2012-12-16 00:35

viewer   ~~0017901

oh ok thanks! its good as long as there is a solution :)

ccw

2012-12-16 01:00

administrator   ~~0017902

Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=4829

Issue History

Date Modified Username Field Change