1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-17 06:07:12 +00:00

Merge pull request #438 from josephcsible/leave-saved-tortoise

Make Orb of Magnetism and Curse of Repulsion leave saved tortoises alone
This commit is contained in:
Zeno Rogue
2025-10-09 08:22:17 +02:00
committed by GitHub

View File

@@ -33,6 +33,8 @@ EX bool canPickupItemWithMagnetism(cell *c, cell *from) {
return false; return false;
if(c->item == itCompass && from->item) if(c->item == itCompass && from->item)
return false; return false;
if(saved_tortoise_on(c))
return false;
return true; return true;
} }
@@ -44,7 +46,7 @@ EX bool doPickupItemsWithMagnetism(cell *c) {
cw += wstep; cw += wstep;
for(int j=1; j<c3->type; j++) { for(int j=1; j<c3->type; j++) {
cell *c4 = (cw+j).peek(); cell *c4 = (cw+j).peek();
if(!isNeighbor(c, c4) && c3->item && !c4->item && passable(c4, c3, ZERO)) { if(!isNeighbor(c, c4) && c3->item && !c4->item && !saved_tortoise_on(c3) && passable(c4, c3, ZERO)) {
changes.ccell(c3); changes.ccell(c3);
changes.ccell(c4); changes.ccell(c4);
moveItem(c3, c4, false); moveItem(c3, c4, false);