Allow using #wiztelekinesis on yourself

This commit is contained in:
Pasi Kallinen
2022-02-24 15:10:39 +02:00
parent 1e951db9bc
commit 16a8caac97

View File

@@ -1236,20 +1236,25 @@ wiz_telekinesis(void)
pline("Pick a monster to hurtle.");
do {
if (mtmp && !DEADMONSTER(mtmp) && canspotmon(mtmp)) {
cc.x = mtmp->mx;
cc.y = mtmp->my;
}
ans = getpos(&cc, TRUE, "a monster");
if (ans < 0 || cc.x < 0)
return ECMD_CANCEL;
if (((mtmp = m_at(cc.x, cc.y)) != 0) && canspotmon(mtmp)) {
if ((((mtmp = m_at(cc.x, cc.y)) != 0) && canspotmon(mtmp))
|| u_at(cc.x, cc.y)) {
if (!getdir("which direction?"))
return ECMD_CANCEL;
mhurtle(mtmp, u.dx, u.dy, 6);
if (mtmp) {
mhurtle(mtmp, u.dx, u.dy, 6);
if (!DEADMONSTER(mtmp) && canspotmon(mtmp)) {
cc.x = mtmp->mx;
cc.y = mtmp->my;
}
} else {
hurtle(u.dx, u.dy, 6, FALSE);
cc.x = u.ux, cc.y = u.uy;
}
}
} while (TRUE);