google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library
https://flatbuffers.dev/
Apache License 2.0
22.52k stars 3.19k forks source link

lua: fix generated code for adding table #8262

Open serprex opened 3 months ago

serprex commented 3 months ago

Example with issue:

table Test { x: int; }
table TestContainer { a: Test; b: Test; }

Generated code has TestContainer.AddA calling PrependStructSlot. Looking at the sample_binary.lua it's using explicit builder:PrependUOffsetTRelative to setup weapon vector. Update generated code to use PrependUOffsetTRelativeSlot