Spellcasting Monsters Misjudge Circular Distances #71699
Labels
(S1 - Need confirmation)
Report waiting on confirmation of reproducibility
stale
Closed for lack of activity, but still valid.
Describe the bug
Monsters who can cast spells do not appear to correctly be judging the distance to the player along diagonals. Spellcasting monsters are sort of rare and most monsters cast spells infrequently (moving up to melee if they flub a cast) so I'm not surprised this didn't get noticed.
Attach save file
N/A
Steps to reproduce
Make a new game with circular distances on.
Give a monster a spell via special_attacks with a fixed range. Set that monster's cooldown to 1, so that it will try to use the spell every turn.
Try standing at certain diagonal angles. The monster will stand just out of reach and try unsuccessfully to cast on you over and over again.
Set the distances to square and see that this does not happen.
Expected behavior
Monsters should not try to cast spells when they're out of range just because they can't do trigonometry.
Screenshots
No response
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Portal Storms Ignore NPCs [personal_portal_storms],
Slowdown Fungal Growth [no_fungal_growth]
]
Additional context
I think the relevant code is at line 295 in mattack_actors.cpp
I discovered this while working on #71584 . I'd fix it myself but I'm not actually sure what's wrong.
The text was updated successfully, but these errors were encountered: