Skip to content

Commit

Permalink
Heroes consider locked doors when defending rooms (#3749)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loobinex authored Dec 9, 2024
1 parent 5c26616 commit 64e96a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/creature_states_hero.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,18 @@ TbBool good_setup_sabotage_rooms(struct Thing* creatng, long dngn_id)

TbBool good_setup_defend_rooms(struct Thing* creatng)
{
struct Room* room = find_nearest_room_to_vandalise(creatng, creatng->owner, NavRtF_NoOwner);
struct Room* room = find_nearest_room_to_vandalise(creatng, creatng->owner, NavRtF_Default);
if (room_is_invalid(room))
{
return false;
}
struct Coord3d pos;
if (!find_random_valid_position_for_thing_in_room(creatng, room, &pos) || !creature_can_navigate_to_with_storage(creatng, &pos, NavRtF_NoOwner))
if (!find_random_valid_position_for_thing_in_room(creatng, room, &pos) || !creature_can_navigate_to_with_storage(creatng, &pos, NavRtF_Default))
{
ERRORLOG("The %s index %d cannot defend %s because it cannot reach position within it", thing_model_name(creatng), (int)creatng->index, room_code_name(room->kind));
return false;
}
if (!setup_random_head_for_room(creatng, room, NavRtF_NoOwner))
if (!setup_random_head_for_room(creatng, room, NavRtF_Default))
{
ERRORLOG("The %s index %d cannot defend %s because it cannot head for it", thing_model_name(creatng), (int)creatng->index, room_code_name(room->kind));
return false;
Expand Down

0 comments on commit 64e96a9

Please sign in to comment.