]> granicus.if.org Git - nethack/commit
monst vs steed tidbit
authornethack.rankin <nethack.rankin>
Sat, 2 Jun 2007 22:00:29 +0000 (22:00 +0000)
committernethack.rankin <nethack.rankin>
Sat, 2 Jun 2007 22:00:29 +0000 (22:00 +0000)
commit61cd699405db5d54d3c1254d467c93661060e989
tree2a3fc427064cc16e058d1b0b8ceb4569ef8bf8d9
parent2f9d711237d010430258fec15c61a6826e7eb2a2
monst vs steed tidbit

     I came across an old bug report which stated that steeds missed out
on their chance to counterattack if the hero had just taken some action
other than moving.
        [1: monster attacks steed instead of hero ]
        [2: if monster died while attacking, return 1 ]
        if (i & MM_DEF_DIED || u.ux != u.ux0 || u.uy != u.uy0)
                return (0);
        [4: otherwise, steed counterattacks monster ]
Sometime since whatever version the 2001 report was for, but before the
current cvs repository was set up someone addressed this by changing it
to be
        if (i & MM_DEF_DIED || !u.umoved)
                return (0);
but I think that fixed the wrong thing.  I believe that the original code
was attempting to make sure that the steed was still in position to be
able to counterattack.  There's no reason to care about the hero's most
recent action; he had to have done something that caused time to elapse
in order for the other monster to have initiated an attack in the first.
(The new range check is actually redundant; mattackm() also enforces it.)
src/mhitu.c