1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-18 01:54:05 +00:00

Merge pull request #231 from jruderman/alch_dice

Fix crash: prevent slime from duplicating dice
This commit is contained in:
Zeno Rogue
2021-07-12 17:04:58 +02:00
committed by GitHub

View File

@@ -1093,16 +1093,20 @@ EX int fatigue_cost(const movei& mi) {
(againstWind(mi.s, mi.t) ? 0 : 1);
}
bool alchMayDuplicate(eWall w) {
return !isDie(w) && w != waBoat && w != waArrowTrap;
}
bool pcmove::perform_actual_move() {
cell*& c2 = mi.t;
changes.at_commit([&] {
flipplayer = true; if(multi::players > 1) multi::flipped[multi::cpid] = true;
});
if(c2->item && isAlch(c2)) {
if(cwt.at->wall == waBoat)
c2->wall = waNone;
else
if(alchMayDuplicate(cwt.at->wall))
c2->wall = cwt.at->wall;
else
c2->wall = waNone;
}
#if CAP_COMPLEX2
if(c2->wall == waRoundTable) {