Skip to content

Commit

Permalink
Use the maximum bow range constant in monster_ai instead of just the …
Browse files Browse the repository at this point in the history
…number 10.
  • Loading branch information
SoftMonster committed Mar 12, 2018
1 parent e546886 commit e47039f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion monster_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "furniture.h"
#include "furniture_factory.h"
#include "file_path.h"
#include "ranged_weapon.h"

class Behaviour {
public:
Expand Down Expand Up @@ -581,7 +582,7 @@ class Fighter : public Behaviour {
if (auto move = considerBuffs())
return move;
if (distance > 1) {
if (distance < 10) {
if (distance <= MAX_RANGED_DISTANCE) {
if (MoveInfo move = getFireMove(enemyDir, other))
return move;
if (MoveInfo move = getThrowMove(enemyDir, other))
Expand Down
1 change: 0 additions & 1 deletion ranged_weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "view_id.h"
#include "event_listener.h"
#include "vision.h"
#define MAX_RANGED_DISTANCE 10

SERIALIZE_DEF(RangedWeapon, damageAttr, projectileName, projectileViewId)
SERIALIZATION_CONSTRUCTOR_IMPL(RangedWeapon)
Expand Down
1 change: 1 addition & 0 deletions ranged_weapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "util.h"
#include "item.h"
#define MAX_RANGED_DISTANCE 10

class RangedWeapon {
public:
Expand Down

0 comments on commit e47039f

Please sign in to comment.