Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuaLibraryMsg::lmsg_getfieldvalue() does not handle array indexing correctly, the first element is always returned #409

Open
elidwa opened this issue May 31, 2024 · 0 comments

Comments

@elidwa
Copy link
Contributor

elidwa commented May 31, 2024

LuaLibraryMsg::lmsg_getfieldvalue() is designed to work with arrays. However, when running the test atl03_viewer.lua, I observed that regardless of the index value provided for the array, the function always returns the first element. I verified that the array is populated with different segment_id values for elements in the array.

This can be demonstrated using the atl03_viewer.lua test script:

print("segment 0", extentrec:getvalue("segments[0].segment_id"))
print("segment 10", extentrec:getvalue("segments[10].segment_id"))
print("segment 100", extentrec:getvalue("segments[100].segment_id"))

The output is as follows:

segment 0 555764.0
segment 10 555764.0
segment 100 555764.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant