fixed elfs being displayed as humans

reduced radius of chasing enemies
added warning to -c option
This commit is contained in:
2024-07-15 14:52:28 -04:00
parent 295b808e14
commit 9ad553706a
4 changed files with 9 additions and 10 deletions

View File

@ -20,7 +20,7 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
if (is_adjacent(pos, pc->get_pos()) && hostile)
return attack(pc);
if (enabled_features & FEATURE_ENEMIES_CHASE &&
if (enabled_features & FEATURE_ENEMIES_CHASE && hostile &&
distance_sqr(pos, pc->get_pos()) <= DIST_THRESHOLD_SQR) {
position tmp;
position target = {BIG_NUMBER, BIG_NUMBER};
@ -28,8 +28,7 @@ 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->get_room(tmp) == room_num &&
lvl->is_available(tmp) &&
if (lvl->is_available(tmp) &&
distance_sqr(tmp, pc->get_pos()) <
distance_sqr(target, pc->get_pos()))
target = tmp;
@ -43,7 +42,8 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
position choices[DIRECTION_CNT];
for (int i = 0; i < DIRECTION_CNT; ++i)
if (lvl->get_room(pos + MOVE[i]) == room_num &&
if (((enabled_features & FEATURE_ENEMIES_CHASE) ?
true : lvl->get_room(pos + MOVE[i]) == room_num ) &&
lvl->is_available(pos + MOVE[i])) {
choices[choices_cnt] = pos + MOVE[i];
++choices_cnt;