View Issue Details

IDProjectCategoryView StatusLast Update
0007196Multi Theft Auto : San AndreasServerpublic2012-10-04 22:07
ReporterVWOerAssigned Toccw 
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
PlatformPCOSWindowsOS Version7
Product Version 
Target Version1.3.2Fixed in Version1.3.2 
Summary0007196: getElementChildren seems not to work on custom element types
Description

If I use the following code, I will still get all elements returned.

getElementChildren(currentSkin, "teamspawn")

It's like MTA ignores whatever type is filled in, and uses nil.

TagsNo tags attached.

Activities

W

2012-07-20 11:27

viewer   ~~0017106

Last edited: 2012-07-20 11:30

I can confirm this:

Test resource: http://fullserver.eu/pio/tmp/7196.zip
Code:

local re=createElement("rootElement")

for i=1,3 do
local ce=createElement("childElement1")
setElementParent(ce,re)
end

for i=1,3 do
local ce=createElement("childElement2")
setElementParent(ce,re)
end

local children=getElementChildren(re, "childElement1")
outputChatBox("rootElement has " .. #children .. " children elements")

getElementChildren(re,"childElement1") returns 6 elements instead of 3.

VWOer

2012-07-20 11:33

viewer   ~~0017107

I've used getElementsByType("skinspawn", currentSkin) now, which does work and has same functionality.

ccw

2012-08-19 20:11

administrator   ~~0017324

Last edited: 2012-08-19 20:11

Unable to reproduce.
getElementChildren(re,"childElement1") returns 3 elements for me.

btw:
getElementChildrenCount ( re,"childElephants" ) will return the number 6 because it doesn't use the 2nd argument.

btw 2:
getElementChildren only looks for direct children. getElementsByType is not exactly the same as it searches all the way down the element tree.

W

2012-09-12 15:09

viewer   ~~0017552

http://i.imgur.com/2qT2c.png

I can't reproduce it anymore, seems fixed.

Issue History

Date Modified Username Field Change