1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

parser:: ifz function

This commit is contained in:
Zeno Rogue 2022-04-24 22:10:43 +02:00
parent d82ac26ef0
commit 0c7a429985

View File

@ -323,6 +323,14 @@ cld exp_parser::parse(int prio) {
cld no = parsepar(); cld no = parsepar();
res = real(cond) > 0 ? yes : no; res = real(cond) > 0 ? yes : no;
} }
else if(eat("ifz(")) {
cld cond = parse(0);
force_eat(",");
cld yes = parse(0);
force_eat(",");
cld no = parsepar();
res = abs(cond) < 1e-8 ? yes : no;
}
else if(eat("wallif(")) { else if(eat("wallif(")) {
cld val0 = parse(0); cld val0 = parse(0);
force_eat(","); force_eat(",");