Skip to content

Conversation

@kphoenix137
Copy link
Collaborator

@kphoenix137 kphoenix137 commented Dec 12, 2025

Fixes: #6693


LineClearMissile()
Monsters ask:

"Can I shoot the player?"

  1. LineClear(PosOkMissile, start, end)
  2. PosOkMissile(tile) = true if the tile is not BlockMissile.

CheckMissileCol()
Missiles ask:

"Can I move through this tile?"

  1. !IsMissileBlockedByTile(tile)
  2. false if:
    • out of bounds
    • tile has BlockMissile
    • there’s an object with _oMissFlag == false

To remedy this, this PR adds a variant function called LineClearMovingMissile(), which is exclusively used when we need to check if a missile would be able to make it between 2 points without hitting an obstruction according to CheckMissileCol(). LineClearMissile() continues to be used for missiles that do not need to travel, such as Leoric summoning a minion at a position, or the player casting a Guardian at a position.

This fix has edge cases due to differing logic between LineClear() and how a missile moves along a path with MoveMissile(). This is the 2nd of the 4 needed fixes for the the problems with ranged monsters/ranged spells (like Guardian), and the 1st already has been merged back in 2023.

1. Missile Space Distortion fix
2. Same checks for missile path success and confirming missile path has no obstructions (This PR)
3. Same logic for missile path and confirming missile path has no obstructions
4. Ranged monster AI tweaks to prevent standing still with no valid line of sight for missiles

@kphoenix137 kphoenix137 marked this pull request as draft December 12, 2025 01:02
@kphoenix137 kphoenix137 marked this pull request as ready for review December 12, 2025 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue Report]: Possible ai bug with succubi

1 participant