Fix: monster hurtling and liquid
A monster hurtling over liquid would drown immediately the instant it touched the first square of water, even if normally it would have kept moving (e.g. hurtling over a short moat). Additionally, its placement on liquid would not take into consideration other monsters, so it could overwrite an existing monster on that spot and lead to an impossible, and/or two monsters occupying a single position. Fix these issues, so that liquid effects like drowning only happen if the monster ends up in liquid at the end of the hurtle, and so that other monsters in the way will stop it early even if they're floating over or swimming on a pool/water/lava square. Also use canspotmon instead of canseemon for the wiztelekinesis debug command.
This commit is contained in:
committed by
Pasi Kallinen
parent
8e91320d2f
commit
1e951db9bc
@@ -1236,7 +1236,7 @@ wiz_telekinesis(void)
|
||||
|
||||
pline("Pick a monster to hurtle.");
|
||||
do {
|
||||
if (mtmp && !DEADMONSTER(mtmp) && canseemon(mtmp)) {
|
||||
if (mtmp && !DEADMONSTER(mtmp) && canspotmon(mtmp)) {
|
||||
cc.x = mtmp->mx;
|
||||
cc.y = mtmp->my;
|
||||
}
|
||||
@@ -1245,7 +1245,7 @@ wiz_telekinesis(void)
|
||||
if (ans < 0 || cc.x < 0)
|
||||
return ECMD_CANCEL;
|
||||
|
||||
if (((mtmp = m_at(cc.x, cc.y)) != 0) && canseemon(mtmp)) {
|
||||
if (((mtmp = m_at(cc.x, cc.y)) != 0) && canspotmon(mtmp)) {
|
||||
if (!getdir("which direction?"))
|
||||
return ECMD_CANCEL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user