diff --git a/pcmove.cpp b/pcmove.cpp index 1918bcff..77b43d11 100644 --- a/pcmove.cpp +++ b/pcmove.cpp @@ -1272,6 +1272,20 @@ bool alchMayDuplicate(eWall w) { return !isDie(w) && w != waBoat && w != waArrowTrap; } +EX bool winter_collect(cell *c2) { + int qty = 0; + if(items[itOrbWinter]) + forCellEx(c3, c2) if(c3->wall == waIcewall && c3->item) { + changes.ccell(c3); + markOrb(itOrbWinter); + eItem it = c3->item; + if(collectItem(c3, cwt.at)) qty++; + if(!c3->item) + animate_item_throw(c3, c2, it); + } + return qty; + } + bool pcmove::perform_actual_move() { cell*& c2 = mi.t; changes.at_commit([&] { @@ -1327,17 +1341,8 @@ bool pcmove::perform_actual_move() { invismove = false; cwt.at->wall = waIcewall; } - - if(items[itOrbWinter]) - forCellEx(c3, c2) if(c3->wall == waIcewall && c3->item) { - changes.ccell(c3); - markOrb(itOrbWinter); - eItem it = c3->item; - if(collectItem(c3, cwt.at)) - return true; - if(!c3->item) - animate_item_throw(c3, c2, it); - } + + if(winter_collect(c2)) return true; movecost(cwt.at, c2, 2); diff --git a/shmup.cpp b/shmup.cpp index 79833a61..74136070 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -1294,6 +1294,7 @@ void movePlayer(monster *m, int delta) { firetraplist.emplace(ticks + 800, c2); } + winter_collect(c2); if(c2->item == itOrbYendor && !peace::on) yendor::check(c2); collectItem(c2, m->base); movecost(m->base, c2, 2);