mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-22 05:50:09 +00:00
removed redundant pre-changes orbused rollback, and made it more elegant in movegolem
This commit is contained in:
parent
9110b6ac88
commit
466cc5cc0a
@ -200,8 +200,6 @@ EX bool monstersnear_aux() {
|
||||
changes.value_set(passive_switch, (gold() & 1) ? moSwitch1 : moSwitch2);
|
||||
multi::cpid++;
|
||||
bool b = false;
|
||||
bool recorduse[ittypes];
|
||||
for(int i=0; i<ittypes; i++) recorduse[i] = orbused[i];
|
||||
if(multi::cpid == multi::players || multi::players == 1 || multi::checkonly) {
|
||||
|
||||
if(shmup::delayed_safety) return false;
|
||||
@ -235,7 +233,6 @@ EX bool monstersnear_aux() {
|
||||
}
|
||||
else b = !multimove();
|
||||
multi::cpid--;
|
||||
for(int i=0; i<ittypes; i++) orbused[i] = recorduse[i];
|
||||
return b;
|
||||
}
|
||||
|
||||
@ -296,11 +293,7 @@ EX void checkmove() {
|
||||
|
||||
if(multi::players > 1 && !multi::checkonly) return;
|
||||
if(hardcore) return;
|
||||
bool orbusedbak[ittypes];
|
||||
|
||||
// do not activate orbs!
|
||||
for(int i=0; i<ittypes; i++) orbusedbak[i] = orbused[i];
|
||||
|
||||
legalmoves.clear(); legalmoves.resize(cwt.at->type+1, false);
|
||||
move_issues.clear(); move_issues.resize(cwt.at->type, 0);
|
||||
|
||||
@ -356,7 +349,6 @@ EX void checkmove() {
|
||||
}
|
||||
items[itWarning]-=2;
|
||||
|
||||
for(int i=0; i<ittypes; i++) orbused[i] = orbusedbak[i];
|
||||
if(recallCell.at && !markOrb(itOrbRecall)) activateRecall();
|
||||
}
|
||||
|
||||
|
@ -5115,10 +5115,7 @@ EX void drawthemap() {
|
||||
cellwalker cw = cwt; bool f = flipplayer;
|
||||
items[itWarning]+=2;
|
||||
|
||||
bool recorduse[ittypes];
|
||||
for(int i=0; i<ittypes; i++) recorduse[i] = orbused[i];
|
||||
movepcto(mousedest.d, mousedest.subdir, true);
|
||||
for(int i=0; i<ittypes; i++) orbused[i] = recorduse[i];
|
||||
items[itWarning] -= 2;
|
||||
if(cw.spin != cwt.spin) mirror::act(-mousedest.d, mirror::SPINSINGLE);
|
||||
cwt = cw; flipplayer = f;
|
||||
|
@ -1686,8 +1686,7 @@ EX void movegolems(flagtype flags) {
|
||||
if(m == moGolem) qg++;
|
||||
if(m == moFriendlyGhost) markOrb(itOrbUndeath);
|
||||
|
||||
bool recorduse[ittypes];
|
||||
for(int i=0; i<ittypes; i++) recorduse[i] = orbused[i];
|
||||
auto recorduse = orbused;
|
||||
|
||||
DEBB(DF_TURN, ("stayval"));
|
||||
int bestv = stayvalue(m, c);
|
||||
@ -1711,7 +1710,7 @@ EX void movegolems(flagtype flags) {
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0; i<ittypes; i++) orbused[i] = recorduse[i];
|
||||
orbused = recorduse;
|
||||
|
||||
// printf("stayvalue = %d, result = %d, bq = %d\n", stayvalue(m,c), bestv, bq);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user