Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

[ZScript] Negative constants don't work!

4 replies · 1,618 views · Started 19 July 2008

This is an easy fix. In ffscript.lpp, change line 101 from:

([0-9]*\.?[0-9]+)  ...

to

(\-?[0-9]*\.?[0-9]+)  ...

And regenerate the parser. It then accepts negative constants. [strike]I haven't verified that it works properly, however (I don't see why not, though)[/strike]

Edit: I tested this, and it appears to work fine. Funny, I recall someone saying this would be a pain to fix...

pkmnfrk wrote:This is an easy fix. In ffscript.lpp, change line 101 from:

Edit: I tested this, and it appears to work fine. Funny, I recall someone saying this would be a pain to fix...

It was me. 😛 Though seeing how long this bug has been here I'm not the only one. Thank you.

Gleeok wrote:It was me. 😛 Though seeing how long this bug has been here I'm not the only one. Thank you.


Here's the funny part, which would explain why I haven't committed it yet: The above fix is fundamentally broken! It makes constants work, yes, but it breaks subtraction (which, arguably, is more important)!

But, I've got an idea for a better fix, which I'll try tonight...