Hi Jonathan,Jonathan wrote:I've seen the code. It starts a new wall (same if you SavePos before Point). But the point is, is this officially supported ("because the game does it") and should any parser accept it?philippeqc wrote:You seem to be lacking a SavePos in the first example, so I dont know the value to pop out of RestorePos.Jonathan wrote:although less than 24 hours ago I attempted to write a parser based on Armagetron's code (since I'm not familiar with libxml). That got me wondering if a parser should parsewith the same results asCode: Select all
<Wall><Point x="10" y="0"/><Point x="20" y="0"/><RestorePos/><Point x="-10" y="0"/><Point x="-20" y="0"/></Wall>
, or maybe not at all (even though it works in Armagetron).Code: Select all
<Wall><Point x="10" y="0"/><Point x="20" y="0"/></Wall><Wall><Point x="-10" y="0"/><Point x="-20" y="0"/></Wall>
I've investigated your question and my answer is "no, it is not officially supported.". It is mostly an unexpected behavior. SavePos and RestorePos are now deprecated, so I'd keep to their formal definition.
-ph
Nota: it was quite a twisted question there. Very good observation. I failed to understand it for a while as I kept thinking about its purpose, not the exact code. Sorry for the delay.