few (really) minor adjustments on monster pathfinding.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5487 c06c8d41-db1a-0410-9941-cceddc491573
NPTVMSNYWIALN2GSKESU6NKX7XNG7QDH2TNIWUB6R6NHCLK32NFAC
UTKZUB7Z3YPIZMMGF5DUOKNZX3GWY46A4GUHX5GA2GMQCT2EWXSQC
Y4NA3JSN63RLATF4NNBPSR5CWF5Z7UEMWCGVX4B6NOAR47CGM4GQC
IGN3Q5YCLHXKWFZQRSRABCHW2JFW5TFVU7TM5EXE2EW7PDBBSQWAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
VWYVIRKY35DS4V6HJXEZK3O2NJWNA3LAARRXITR35GIE2HMQK55AC
4PBRMB7TK2TXL7VSDKMUQMT4QFK3SGRU4TUVMEM7V2VS7KKKILAQC
EJYK3CKIEMP4NMZUCMUYLHIBE7A3LPZOU7DUON5V7CPHY7QEKLEAC
ECUYJLVGW6ADRLLF2WOMRG464VHOVDPP5OK5SAX2PHBUUC5FD4TQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
FU7EQZLXD7YNGUUDHXCBI3VUKL6M2G3EPDY6FB5UA6B6RD4S5UOQC
P5TRGRH7XMQSPCZKM5IEEO34TY6WMLGHHX7BU6Y453JFRXLUR2VQC
SQYAXIFB4Y2N2TIJ77ZMKC5MYV23MMB7MOYEZXOSWPMLCYYKRMJAC
EJKHYV2Z6UPRVYUAL4WRW33GBNHYBFPMPA57HMBX2LQKXHIUO5VQC
TPPJRQ2NTCV3GI2VRHEXQJREDERPJODCJWUG5WCOQGN4REPPPAMAC
7YUGK5Q64KG5O7GJGTUBRRLHAHBCJ5YOE23YUPT6UBKUSB67CYAQC
for (int dir = 0; dir < 8; dir++)
// For each point, we look at all neighbour points. Check the orthogonals
// last, so that, should an orthogonal and a diagonal direction have the
// same total travel cost, the orthogonal will be picked first, and thus
// zigzagging should be avoided. This means directions are looked at, in
// order: 1, 3, 5, 7, 0, 2, 4, 6. (dir = 0) is an intentional assignment.
for (int dir = 1; dir < 8; (dir += 2) == 9 && (dir = 0))
/* BCR - Added a check for monsters in the way. Only checks cardinal
* directions. Knight moves are ignored. Assume the weapon
* slips between the squares.
*/
// BCR - Added a check for monsters in the way. Only checks cardinal
// directions. Knight moves are ignored. Assume the weapon
// slips between the squares.
you_attack(mgrd[beam.tx][beam.ty], false);
success = you_attack(mgrd[beam.tx][beam.ty], false);
}
if (success)
{
int mid = mgrd[beam.tx][beam.ty];
if (mid != NON_MONSTER)
{
monsters *mon = &menv[mgrd[beam.tx][beam.ty]];
if (mons_is_mimic( mon->type ))
mimic_alert(mon);
}