reworked some arguments

This commit is contained in:
2024-07-15 15:26:28 -04:00
parent 9ad553706a
commit 55d269a220
3 changed files with 12 additions and 13 deletions

View File

@ -28,7 +28,9 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
for (int i = 0; i < DIRECTION_CNT; ++i) {
tmp = pos + MOVE[i];
if (lvl->is_available(tmp) &&
if (((enabled_features & FEATURE_DOORS) ? true
: lvl->get_room(tmp) == room_num) &&
lvl->is_available(tmp) &&
distance_sqr(tmp, pc->get_pos()) <
distance_sqr(target, pc->get_pos()))
target = tmp;
@ -42,7 +44,7 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
position choices[DIRECTION_CNT];
for (int i = 0; i < DIRECTION_CNT; ++i)
if (((enabled_features & FEATURE_ENEMIES_CHASE) ?
if (((enabled_features & FEATURE_DOORS) ?
true : lvl->get_room(pos + MOVE[i]) == room_num ) &&
lvl->is_available(pos + MOVE[i])) {
choices[choices_cnt] = pos + MOVE[i];