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
commit 40b0a6d13d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

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) {