mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-10-31 19:36:16 +00:00
when having Orb of Freedom + Orb of Time, other orbs are no longer drained by Freedom checks
This commit is contained in:
parent
253bec46cb
commit
162edb85a8
@ -179,8 +179,7 @@ EX namespace dual {
|
|||||||
dynamicval<int> dm(dual::state, 2);
|
dynamicval<int> dm(dual::state, 2);
|
||||||
int cg = currently_loaded;
|
int cg = currently_loaded;
|
||||||
|
|
||||||
bool orbusedbak[ittypes];
|
auto orbusedbak = orbused;
|
||||||
for(int i=0; i<ittypes; i++) orbusedbak[i] = orbused[i];
|
|
||||||
|
|
||||||
if(d < 0) {
|
if(d < 0) {
|
||||||
if(d == -2 && items[itGreenStone] < 2) {
|
if(d == -2 && items[itGreenStone] < 2) {
|
||||||
@ -193,7 +192,7 @@ EX namespace dual {
|
|||||||
for(int k=0; k<2; k++) {
|
for(int k=0; k<2; k++) {
|
||||||
switch_to(k);
|
switch_to(k);
|
||||||
ok = ok && movepcto(d, subdir, true);
|
ok = ok && movepcto(d, subdir, true);
|
||||||
for(int i=0; i<ittypes; i++) orbused[i] = orbusedbak[i];
|
orbused = orbusedbak;
|
||||||
}
|
}
|
||||||
if(ok && checkonly) {
|
if(ok && checkonly) {
|
||||||
switch_to(cg);
|
switch_to(cg);
|
||||||
|
4
orbs.cpp
4
orbs.cpp
@ -8,7 +8,8 @@
|
|||||||
#include "hyper.h"
|
#include "hyper.h"
|
||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
EX bool orbused[ittypes], lastorbused[ittypes];
|
EX array<bool, ittypes> orbused;
|
||||||
|
EX array<bool, ittypes> lastorbused;
|
||||||
|
|
||||||
EX bool markOrb(eItem it) {
|
EX bool markOrb(eItem it) {
|
||||||
if(!items[it]) return false;
|
if(!items[it]) return false;
|
||||||
@ -314,6 +315,7 @@ EX bool distanceBound(cell *c1, cell *c2, int d) {
|
|||||||
|
|
||||||
EX void checkFreedom(cell *cf) {
|
EX void checkFreedom(cell *cf) {
|
||||||
manual_celllister cl;
|
manual_celllister cl;
|
||||||
|
dynamicval<decltype(orbused)> d(orbused);
|
||||||
cl.add(cf);
|
cl.add(cf);
|
||||||
for(int i=0; i<isize(cl.lst); i++) {
|
for(int i=0; i<isize(cl.lst); i++) {
|
||||||
cell *c = cl.lst[i];
|
cell *c = cl.lst[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user