mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-01 21:10:35 +00:00
Merge pull request #231 from jruderman/alch_dice
Fix crash: prevent slime from duplicating dice
This commit is contained in:
commit
40b0a6d13d
10
pcmove.cpp
10
pcmove.cpp
@ -1093,16 +1093,20 @@ EX int fatigue_cost(const movei& mi) {
|
|||||||
(againstWind(mi.s, mi.t) ? 0 : 1);
|
(againstWind(mi.s, mi.t) ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool alchMayDuplicate(eWall w) {
|
||||||
|
return !isDie(w) && w != waBoat && w != waArrowTrap;
|
||||||
|
}
|
||||||
|
|
||||||
bool pcmove::perform_actual_move() {
|
bool pcmove::perform_actual_move() {
|
||||||
cell*& c2 = mi.t;
|
cell*& c2 = mi.t;
|
||||||
changes.at_commit([&] {
|
changes.at_commit([&] {
|
||||||
flipplayer = true; if(multi::players > 1) multi::flipped[multi::cpid] = true;
|
flipplayer = true; if(multi::players > 1) multi::flipped[multi::cpid] = true;
|
||||||
});
|
});
|
||||||
if(c2->item && isAlch(c2)) {
|
if(c2->item && isAlch(c2)) {
|
||||||
if(cwt.at->wall == waBoat)
|
if(alchMayDuplicate(cwt.at->wall))
|
||||||
c2->wall = waNone;
|
|
||||||
else
|
|
||||||
c2->wall = cwt.at->wall;
|
c2->wall = cwt.at->wall;
|
||||||
|
else
|
||||||
|
c2->wall = waNone;
|
||||||
}
|
}
|
||||||
#if CAP_COMPLEX2
|
#if CAP_COMPLEX2
|
||||||
if(c2->wall == waRoundTable) {
|
if(c2->wall == waRoundTable) {
|
||||||
|
Loading…
Reference in New Issue
Block a user