Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: A check for monsters having ranged spells
The function mons_has_ranged_spell() didn't considered spells marked as ranged by _ms_ranged_spell() to actually be ranged unless their range was greater than 1. The problem with this is that many LOS-affecting spells have an undefined range, which gets resolved to a range of -1. Hence a monster like a curse toe with e.g. Symbol of Torment and only summons as its other spells was incorrectly not flagged as ranged. This commit only excludes attack spells if their range is exactly 1. I've looked over all calls to mons_has_ranged_spell() and there's nothing that should break if we expand the list of monster ranged spells in this way. It might be good to actually designate a LOS range for all the various smite targeted attack spells for clarity in the monster info UI. Smiting itself already has such a range, for example. I'm not changing any spell definitions for now, since I've not checked if those changes could somehow have other side effects. Monster AI is notorious for having subtle bugs. (cherry picked from commit 585c54f536188b0a9123da2be5ea99197ebdd732)
- Loading branch information