mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 09:50:34 +00:00
fixed Orb of Safety in multiplayer
This commit is contained in:
parent
67bf4586ac
commit
f69b6f0795
@ -158,7 +158,8 @@ EX bool monstersnear2() {
|
||||
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;
|
||||
dynamicval<eMonster> sw(passive_switch, passive_switch);
|
||||
|
||||
for(int i=0; i<isize(stalemate::moves); i++)
|
||||
|
@ -147,8 +147,10 @@ EX bool collectItem(cell *c2, bool telekinesis IS(false)) {
|
||||
|
||||
playSound(c2, "pickup-orb"); // TODO safety
|
||||
if(!dual::state) items[c2->item] = 7;
|
||||
if(shmup::on)
|
||||
if(shmup::on || multi::players > 1) {
|
||||
shmup::delayed_safety = true;
|
||||
shmup::delayed_safety_land = c2->land;
|
||||
}
|
||||
else
|
||||
activateSafety(c2->land);
|
||||
return true;
|
||||
|
13
multi.cpp
13
multi.cpp
@ -927,10 +927,17 @@ EX void handleInput(int delta) {
|
||||
}
|
||||
|
||||
multi::cpid = 0;
|
||||
if(multimove()) {
|
||||
if(multimove()) {
|
||||
multi::aftermove = false;
|
||||
monstersTurn();
|
||||
checklastmove();
|
||||
if(shmup::delayed_safety) {
|
||||
activateSafety(shmup::delayed_safety_land);
|
||||
shmup::delayed_safety = false;
|
||||
checklastmove();
|
||||
}
|
||||
else {
|
||||
monstersTurn();
|
||||
checklastmove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -100,6 +100,7 @@ ld fabsl(ld x) { return x>0?x:-x; }
|
||||
|
||||
EX bool on = false;
|
||||
EX bool delayed_safety = false;
|
||||
EX eLand delayed_safety_land;
|
||||
|
||||
bool lastdead = false;
|
||||
|
||||
@ -2697,7 +2698,7 @@ EX void turn(int delta) {
|
||||
additional.clear();
|
||||
|
||||
if(delayed_safety) {
|
||||
activateSafety(pc[0]->base->land);
|
||||
activateSafety(delayed_safety_land);
|
||||
delayed_safety = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user