Smoker smoke can travel through walls

So I’m holed up in a one entrance bathroom in a house while a horde rushes it. Around the outside, a smoker comes along late to the party while I’m fighting zombies, but it manages to somehow smoke through the wall of the house. I could tell because it showed up as a ? along the wall as it smoked through them. This is really stupid. It should have to have an actual line to you to smoke at you. Needs to be fixed.

Yeah a byproduct of how it produces smoke - it produces it from the aether in a circle around itself, and that’s just outright where it appears. It should be blocked by walls but I personally don’t know of an easy way to do that.

Roughly:

std::vector<point> smoke_candidates = closest_points_first(smoke_distance, smoker.x, smoker.y);
for( std::vector<point>::iterator smoke_candidate = smoke_candidates.begin();
     smoke_candidate != smoke_candidates.end(); ++smoke_candidate  ) {
    int junk;
    if( m.clear_path( smoker.x, smoker.y, smoke_candidate.x, smoke_candidate.y,
                      smoke_distance, -1, 100, junk ) ) {
        // Place smoke
    }
}

I have my hands TOTALLY full merging, or I would have hit this one (issue #849), and the similar issue with NPC targeting (#58!!!) and crafting (#995) a long time ago :frowning:

Do we have a monster_can_see() function? Modify that so that it can see through everything but walls, and you’re set.

If it took me 20 seconds to think of it, it should only take 20 seconds to implement it…

The clear_path() function I mentioned does exactly that, though I got the argument wrong now that I think of it, instead of:
if( m.clear_path( smoker.x, smoker.y, smoke_candidate.x, smoke_candidate.y,
smoke_distance, -1, 100, junk ) ) {
it should be:
if( m.clear_path( smoker.x, smoker.y, smoke_candidate.x, smoke_candidate.y,
smoke_distance, 1, 100, junk ) ) {

Explanation, that first numneric argument is the “minimum move cost” per-tile, if move cost is 0, it means non-navigable, in other words a wall. The second is the maximum, but we don’t care about it being too high, so it’s set to a ridiculous value.