diff --git a/src/battle/player.c b/src/battle/player.c index aa3a4ee..a770bbd 100644 --- a/src/battle/player.c +++ b/src/battle/player.c @@ -237,8 +237,8 @@ static void switchGuns(void) static void selectTarget(void) { - unsigned int closest = 65535; - unsigned int dist = 65535; + unsigned int closest = MAX_TARGET_RANGE; + unsigned int dist = MAX_TARGET_RANGE; Entity *e; player->target = NULL; @@ -259,8 +259,8 @@ static void selectTarget(void) static void selectMissionTarget(void) { - unsigned int closest = 65535; - unsigned int dist = 65535; + unsigned int closest = MAX_TARGET_RANGE; + unsigned int dist = MAX_TARGET_RANGE; Entity *e; battle.missionTarget = NULL; diff --git a/src/defs.h b/src/defs.h index f9c5f27..24e5717 100644 --- a/src/defs.h +++ b/src/defs.h @@ -45,6 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define NUM_TEXT_BUCKETS 64 #define MAX_FIGHTER_GUNS 12 +#define MAX_TARGET_RANGE 65536 #define BF_NONE 0 #define BF_ENGINE (2 << 0)