| 102 | } |
| 103 | |
| 104 | boolean |
| 105 | revive_nasty(coordxy x, coordxy y, const char *msg) |
| 106 | { |
| 107 | struct obj *otmp = 0, *otmp2 = 0; |
| 108 | struct monst *mtmp; |
| 109 | coord cc; |
| 110 | boolean revived = FALSE; |
| 111 | |
| 112 | for (otmp = svl.level.objects[x][y]; otmp; otmp = otmp2) { |
| 113 | otmp2 = otmp->nexthere; |
| 114 | if (otmp->otyp == CORPSE |
| 115 | && (is_rider(&mons[otmp->corpsenm]) |
| 116 | || otmp->corpsenm == PM_WIZARD_OF_YENDOR)) { |
| 117 | /* move any living monster already at that location */ |
| 118 | if ((mtmp = m_at(x, y)) && enexto(&cc, x, y, mtmp->data)) |
| 119 | rloc_to(mtmp, cc.x, cc.y); |
| 120 | if (msg) |
| 121 | Norep("%s", msg); |
| 122 | revived = revive_corpse(otmp); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | /* this location might not be safe, if not, move revived monster */ |
| 127 | if (revived) { |
| 128 | mtmp = m_at(x, y); |
| 129 | if (mtmp && !goodpos(x, y, mtmp, 0) |
| 130 | && enexto(&cc, x, y, mtmp->data)) { |
| 131 | rloc_to(mtmp, cc.x, cc.y); |
| 132 | } |
| 133 | /* else impossible? */ |
| 134 | } |
| 135 | |
| 136 | return revived; |
| 137 | } |
| 138 | |
| 139 | #define squeezeablylightinvent() (!gi.invent \ |
| 140 | || inv_weight() <= (WT_SQUEEZABLE_INV * -1)) |
no test coverage detected