There's now cell_see_cell which tests for visibility correctly, albeit slowly. That's only used for placing features in the abyss currently, but needs to be improved if it gets used more.
The second function used in monster movement was left as is, but renamed to can_go_straight. This remains unreliable but probably serves its purpose.
The grid_see_grid test is adapted to cell_see_cell; the grid_see_grid lua binding is now actually useful.
Also reduce the number of tests in los_csc and los_symm.
5IB2YSN5CPEWGGKAWRH52576TKVRJKMNAJT2QP6NGNRZRV5B2MDQC
XUPMPYQWJITYIE3G2CCYVQMHYBGGXS32EIQJG42GNZS6BLE4NFAAC
DRH5HH762ZIS2R6NCKQYD3XO2P6RDNS6N4XEULIEQPNMB46HEDFQC
C25ULNTKMNOXT72ERWSFQZQW5E2OIM3TOGAAA33Z7EZQMZHRS2MAC
3ND2W5F6WDPKMFYUUP5J4TIVSO7MK2OHP3VEBGUCMD4FDL6G57JQC
N22Z7L4XI5LX7UVPSONQNHHPPZF3GLDHGUFDJU265JQYZ3JZEZTQC
HFZQADL3R7ITWM3VPW5G3NCB2AHRMAMKYZOI3STW5LWUCTV4FFFQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
JBZ7NU4BB5PGQWCOSZHD5OQUHQIVOD4XGJLSJQ7BUGQEGPRTVGZQC
5LDEEBB7DT4CORJZOAYLQFXNI7FOURUJGAKVDVX7YL745NNRW63AC
DMG73XDQHY2X2PHKWIY56XKD3O4NPGZKKIO6GX3IV2LLRVXPGKYQC
TGJZXTUIAKCFZQJ54ZQEBGFBVZSJCAX6AWDRSH3TP7UJRLGUM5SAC
RN242L3YZK35BFY7JRTCSYWD6FWDCRFUFDI7PKYFUCA2UPX6ZEAQC
AUXHSGS4EFOPZ6TVZYWNVOUDO7NYKUKE3HBKGQQWTALSVFOE3HAAC
TLO257LZSB6ZO36STDUEWJBO2LETXFKTFGXELA6Y4BZBVAEIIINAC
2EBEWIV4YHXXAFR4GG2GMZJ2K77NK762HNQ77CZLHI3LDVGX7RJAC
ACZYEIX7WMPIIODKCATBCUE626AJ4ZGGBOMVC6BGXM27EQU2RECAC
KIJYTJG2XG7T4HEVZTCL2T4XDSMVLXDJMYYRRK6GY5PY7CGJLJTAC
TFHMBVXTRA2LXBHE7L7OEWK37JQN5DWZ3HOACMN7PRWVJNCS4TYQC
bool grid_see_grid(const coord_def& p1, const coord_def& p2,
dungeon_feature_type allowed = DNGN_UNSEEN);
bool cell_see_cell(const coord_def& p1, const coord_def& p2);
bool can_go_straight(const coord_def& p1, const coord_def& p2,
dungeon_feature_type allowed);
// Usually calculates whether from one grid someone could see the other.
// Depending on the viewer's habitat, 'allowed' can be set to DNGN_FLOOR,
// DNGN_SHALLOW_WATER or DNGN_DEEP_WATER.
// Yes, this ignores lava-loving monsters.
// XXX: It turns out the beams are not symmetrical, i.e. switching
// pos1 and pos2 may result in small variations.
bool grid_see_grid(const coord_def& p1, const coord_def& p2,
dungeon_feature_type allowed)
// Is p2 visible from p1, disregarding clouds?
// XXX: Horribly inefficient since we do an entire LOS calculation;
// needs to be rewritten if it is used more.
bool cell_see_cell(const coord_def& p1, const coord_def& p2)
{
env_show_grid show;
losight(show, los_param_nocloud(p1));
return see_grid(show, p1, p2);
}
// Checks whether there is a straight path from p1 to p2 that passes
// through features >= allowed.
// If it exists, such a path may be missed; on the other hand, it
// is not guaranteed that p2 is visible from p1 according to LOS rules.
// Not symmetric.
bool can_go_straight(const coord_def& p1, const coord_def& p2,
dungeon_feature_type allowed)