Only use NavRtF_NoOwner on salary and teleport#4823
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts several AI/navigation route checks to stop using NavRtF_NoOwner in room-targeting logic, so locked/hidden-door ownership constraints are respected when deciding whether a room is reachable (fixing #4822’s “attack/sabotage rooms ignore locked doors” behavior).
Changes:
- Use
NavRtF_Defaultinstead ofNavRtF_NoOwnerwhen checking reachability of a player’s rooms (creature_can_get_to_any_of_players_rooms). - Use
NavRtF_Defaultfor room-destruction targeting and heading setup in enemy-room destruction flow. - Use
NavRtF_Defaultthroughout hero party “attack rooms” / “sabotage rooms” target selection and movement setup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/room_data.c | Makes “can reach any of player’s rooms” checks respect default navigation constraints. |
| src/creature_states.c | Ensures “destroy enemy room” setup uses default navigation flags for reachability and heading. |
| src/creature_states_hero.c | Updates hero party attack/sabotage room targeting to use default navigation flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
2161
to
2164
| for (RoomKind rkind = 1; rkind < game.conf.slab_conf.room_types_count; rkind++) | ||
| { | ||
| struct Room* room = find_room_of_kind_creature_can_navigate_to(thing, owner, rkind, NavRtF_NoOwner); | ||
| struct Room* room = find_room_of_kind_creature_can_navigate_to(thing, owner, rkind, NavRtF_Default); | ||
| if (!room_is_invalid(room)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4822