1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-30 07:29:54 +00:00

when having Orb of Freedom + Orb of Time, other orbs are no longer drained by Freedom checks

This commit is contained in:
Zeno Rogue 2022-02-26 11:28:37 +01:00
parent 253bec46cb
commit 162edb85a8
2 changed files with 5 additions and 4 deletions

View File

@ -179,8 +179,7 @@ EX namespace dual {
dynamicval<int> dm(dual::state, 2);
int cg = currently_loaded;
bool orbusedbak[ittypes];
for(int i=0; i<ittypes; i++) orbusedbak[i] = orbused[i];
auto orbusedbak = orbused;
if(d < 0) {
if(d == -2 && items[itGreenStone] < 2) {
@ -193,7 +192,7 @@ EX namespace dual {
for(int k=0; k<2; k++) {
switch_to(k);
ok = ok && movepcto(d, subdir, true);
for(int i=0; i<ittypes; i++) orbused[i] = orbusedbak[i];
orbused = orbusedbak;
}
if(ok && checkonly) {
switch_to(cg);

View File

@ -8,7 +8,8 @@
#include "hyper.h"
namespace hr {
EX bool orbused[ittypes], lastorbused[ittypes];
EX array<bool, ittypes> orbused;
EX array<bool, ittypes> lastorbused;
EX bool markOrb(eItem it) {
if(!items[it]) return false;
@ -314,6 +315,7 @@ EX bool distanceBound(cell *c1, cell *c2, int d) {
EX void checkFreedom(cell *cf) {
manual_celllister cl;
dynamicval<decltype(orbused)> d(orbused);
cl.add(cf);
for(int i=0; i<isize(cl.lst); i++) {
cell *c = cl.lst[i];