Map forum?

What do you want to see here? Some more categories, forums, and mods? Hmm...
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Jonathan wrote:
philippeqc wrote:
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 parse

Code: 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>
with the same results as

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>
, or maybe not at all (even though it works in Armagetron).
You seem to be lacking a SavePos in the first example, so I dont know the value to pop out of RestorePos.
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?
Hi Jonathan,

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.
Canis meus id comedit.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

philippeqc wrote: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.
OK. So it is unspecified/undefined behavior.
philippeqc wrote: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.
Hehe. Sometimes I just somehow see unexpected stuff in code. Like the (now fixed) bug which allowed me to kick z-man off his own server "by the server administrator". :)
philippeqc wrote:Sorry for the delay.
No problem.
ˌɑrməˈɡɛˌtrɑn
Post Reply