One class of false errors is when a stair gets placed in the LOS map.
U4RJT4J4ZCOPYRSP42IBYTKQYD2Z4YD3JY5S4ANN6TRVNADRB2BAC dgn.grid(xa, ya) == rock_wall ordgn.grid(xa, ya) == floor)
feat == rock_wall orfeat == floor)local should_not_see = (x ~= 0 or y ~= 0) and(feat == stone_wall or feat == water)if (not (should_see or should_not_see)) thenassert(false, "Illegal feature " .. dgn.feature_name(feat) .. " (" ..feat .. ") at " .. p .. " in " .. name .. ".")end
if can_see and (not should_see) thenassert(false, "los error in " .. name .."(iter #" .. checks .."): can see " .. p .. " but shouldn't.")elseif (not can_see) and should_see thenassert(false, "los error in " .. name .. "(iter #" .. checks .."): should see " .. p .. " but can't.")
local err = can_see and (not should_see) or (not can_see) and should_seeif err thenlocal cans = can_see and "can" or "can't"local shoulds = should_see and "should" or "shouldn't"local errstr = "LOS error in " .. name .. ": " .. shoulds .." see " .. p .. " (" .. feat .. ") but " .. cans .. "."assert(false, errstr)