Page 1 of 1

Struct - Type2

Posted: Tue May 15, 2012 9:00 pm
by Jabantiz
Was finally able to get this working, mostly. For what ever reason type2 is always returning a value of 205 no matter what the struct is set at, I wasn't able to track down the cause of this so in the code I just submitted the value is hardcoded to DATA_STRUCT_SINT16, I know this is bad but seeing as the only struct that uses Type2 as of now is items I went ahead and did this so that items display correctly while the cause of this issue is tracked down.

Also it is important to note that the type that takes the most bytes needs to be in Type, in the case of items Type="float" (4 bytes) Type2="sint16" (2 bytes) if they are reversed world will produce a windows popup (like a crash would) saying that the heap is corrupted (memory was written outside of the allocation) or something like that.

Re: Struct - Type2

Posted: Wed May 16, 2012 5:46 pm
by John Adams
Nice work. I hope the rest of the team (including myself) get back to this soon and can help you out.

Thanks for sticking with it, Jabantiz. I know that was driving you mad.

Re: Struct - Type2

Posted: Wed May 16, 2012 5:52 pm
by Jabantiz
John Adams wrote:Thanks for sticking with it, Jabantiz. I know that was driving you mad.
You have no idea...

And to make it even worse the fix was rather simple, I just didn't know how the code in packetstruct.h/.cpp and configreader.cpp worked so I overlooked this solution several times...