Creature Sight range


#1

So I’ve recently tried to make a terrain flag that affect sight ranges of player and other creature. It works for player : when you step on terrain with the flag your sight is reduced to 1 tile, but when I spawn a monster on the tile and stand more than 1 tile away I still get a ! next to the monster name in the the V menu.

I’ve edited Creature::sees( const tripoint &t, bool is_player ) , and monster::sight_range( const int light_level ) . And here’s the PR
So my question is : what did I miss about creature sight ?


#2

After some more testing it turns out that it works. Spawning the monster directly on the tile was the mistake as monsters spawned on the tile don’t get the effect.