1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-28 11:00:34 +00:00

fixed a bug in parsing unary -

This commit is contained in:
Zeno Rogue 2021-12-09 20:53:52 +01:00
parent 8220611718
commit cfcd8a5e57

View File

@ -327,7 +327,7 @@ cld exp_parser::parse(int prio) {
else if(number == "e") res = exp(1);
else if(number == "i") res = cld(0, 1);
else if(number == "p" || number == "pi") res = M_PI;
else if(number == "" && next() == '-') { at++; res = -parse(prio); }
else if(number == "" && next() == '-') { at++; res = -parse(20); }
else if(number == "") throw hr_parse_exception("number missing, " + where());
else if(number == "s") res = ticks / 1000.;
else if(number == "ms") res = ticks;