World.toXML() error

Started by mystara, August 27, 2009, 12:43:18 PM

Previous topic - Next topic

mystara

Hello,

I've spent a little while trying to figure out why some exported XML structures are not producing any triangles when imported. Looking at the XML files themselves, I discovered that the tag:

<triangle_list>

Is not being exported. I believe that this is a bug and has been introduced in the latest version of JPCT, since the only change I've made to my code is to start using the latest version of JPCT.
The other slightly concerning thing is that the XML importer does not seem to recognise that the XML file is invalid. Shouldn't it notice that the <triangle_list> is missing, and refuse to load it?

Cheers!

EgonOlsen

That part actually hasn't changed for years... ??? Are you using compiled/stripped objects in your application?

mystara

No, not compiled or stripped.

Also, it's only the tag "<triangle_list>" which is missing. The closing tag ("</triangle_list>") is present.

mystara

I should also add that the triangles themselves are ALSO present. It's literally that one tag which is missing.

EgonOlsen

It's a bug...a side effect from some memory saving that i introduced in 1.17. That combined with Config.saveMemory=true being the default in the latest version causes the problem. I've tried to fix it here: http://www.jpct.net/download/beta/jpctapi_119pre1.zip

About the importer not noticing it...that could be. It's a pretty basic parser. It will choke on tags being opened and not closed but i think it may simply ignore ones that don't open anywhere. I think i'll just live with that... ;)

EgonOlsen


mystara

That seems to have fixed the problem.