diasurgical / devilution

Diablo devolved - magic behind the 1996 computer game
Other
8.79k stars 919 forks source link

missiles: add BUGFIX for MI_Element and MI_Bonespirit #2282

Closed mewmew closed 2 years ago

mewmew commented 2 years ago

The Elemental and Bone Spirit spells tries to locate the closest monster at each logic tick, to update the direction of the spell. This is done using the FindClosest function, which returns the monster array index of the closest monster; or -1 if no monster is located.

The callee of FindClosest checks if mid > 0, and as such does not handle the monster array index 0 case. Since this case is known to be the Golem of player 1, perhaps this is intentional. If so, the FindClosest function should instead be updated to find the closest monster that is NOT a Golem; as the current code will simply fail to find other monsters if there is a Golem of player 1 closer. It will also handle Golems of other players differently than player 1 (regardless of PvP settings).