diff --git a/.github/workflows/install_deps.sh b/.github/workflows/install_deps.sh index 93c45fc5..0190feb4 100755 --- a/.github/workflows/install_deps.sh +++ b/.github/workflows/install_deps.sh @@ -18,6 +18,7 @@ if [[ "$GH_HYP_PNG" == "png_1" ]]; then fi if [[ "$GH_OS" == "ubuntu-latest" ]]; then + sudo apt-get update sudo apt-get -y install $GH_DEPS_UBUNTU elif [[ "$GH_OS" == "macos-latest" ]]; then brew update diff --git a/attack.cpp b/attack.cpp index c1b968df..4d01f20f 100644 --- a/attack.cpp +++ b/attack.cpp @@ -1194,6 +1194,7 @@ EX vector gun_targets(cell *c) { if(passable(c2, c1, P_BULLET | P_FLYING | P_MONSTER)) if(cl.add(c2)) dists.push_back(dists[i] + 1); } + cl.remove(c); return cl.lst; } diff --git a/landlock.cpp b/landlock.cpp index 8284e6c7..fedf0bd7 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -400,6 +400,7 @@ EX bool incompatible1(eLand l1, eLand l2) { if(l1 == laBull && l2 == laTerracotta) return true; if(l1 == laReptile && l2 == laTerracotta) return true; if(l1 == laBull && l2 == laDeadCaves) return true; + if(l1 == laMinefield && l2 == laZebra) return true; if(isElemental(l1) && isElemental(l2)) return true; return false; } @@ -416,8 +417,9 @@ EX int elementalKills() { } EX eLand randomElementalLandWeighted() { - if(all_unlocked) return pick(laEAir, laEWater, laEEarth, laEFire); - int i = hrand(elementalKills()); + int ek = elementalKills(); + if(ek == 0 || all_unlocked) return pick(laEAir, laEWater, laEEarth, laEFire); + int i = hrand(ek); i -= kills[moAirElemental]; if(i<0) return laEAir; i -= kills[moWaterElemental]; if(i<0) return laEWater; i -= kills[moEarthElemental]; if(i<0) return laEEarth; diff --git a/locations.cpp b/locations.cpp index 71f3bb71..d27a5991 100644 --- a/locations.cpp +++ b/locations.cpp @@ -413,6 +413,16 @@ struct manual_celllister { return true; } + /** \brief remove a cell from the list */ + bool remove(cell *c) { + if(!listed(c)) return false; + int i = c->listindex; + c->listindex = tmps[i]; + tmps.erase(tmps.begin() + i); + lst.erase(lst.begin() + i); + return true; + } + ~manual_celllister() { for(int i=0; ilistindex = tmps[i]; } diff --git a/pcmove.cpp b/pcmove.cpp index 0f18dd61..9c2807fc 100644 --- a/pcmove.cpp +++ b/pcmove.cpp @@ -1094,6 +1094,9 @@ bool pcmove::move_if_okay() { return false; } + if(getOLR(c2->item, c2->land) == olrDangerous && !checkonly && warningprotection(XLAT("Collecting %the1 in %the2 can be dangerous -- are you sure?", c2->item, c2->land))) + return false; + if(switchplace_prevent(cwt.at, c2, *this)) return false; if(!checkonly && warningprotection_hit(do_we_stab_a_friend(mi, moPlayer))) diff --git a/quit.cpp b/quit.cpp index 192ab718..df82ee4a 100644 --- a/quit.cpp +++ b/quit.cpp @@ -10,7 +10,7 @@ namespace hr { EX bool quitsaves() { if(casual) return false; - return (items[itOrbSafety] && CAP_SAVE && !arcm::in()); + return (items[itOrbSafety] && CAP_SAVE); } EX bool needConfirmationEvenIfSaved() {