mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-22 23:17:04 +00:00
exp_parser:: user-defined variables take precedence
This commit is contained in:
parent
fa11bc6c27
commit
7cabb8aaf4
4
util.cpp
4
util.cpp
@ -335,7 +335,9 @@ cld exp_parser::parse(int prio) {
|
||||
else if(next() == '(') at++, res = parsepar();
|
||||
else {
|
||||
string number = next_token();
|
||||
if(number == "e") res = exp(1);
|
||||
if(extra_params.count(number)) res = extra_params[number];
|
||||
else if(params.count(number)) res = params.at(number);
|
||||
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); }
|
||||
|
Loading…
Reference in New Issue
Block a user