mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Fixes usage of range() to check distance.
* Fixes all instances of SNPCs using range() to check distance, instead uses get_dist().
This commit is contained in:
@@ -286,6 +286,9 @@
|
||||
else
|
||||
unEquip(I,TRUE)
|
||||
update_hands = 1
|
||||
|
||||
/mob/living/carbon/human/interactive/targetRange(var/towhere)
|
||||
return get_dist(get_turf(towhere), get_turf(src))
|
||||
|
||||
/mob/living/carbon/human/interactive/Life()
|
||||
..()
|
||||
@@ -579,7 +582,7 @@
|
||||
if((TARGET && (doing & FIGHTING)) || graytide) // this is a redundancy check
|
||||
var/mob/living/M = TARGET
|
||||
if(istype(M,/mob/living))
|
||||
if(M in range(FUZZY_CHANCE_LOW,src))
|
||||
if(targetRange(M) <= FUZZY_CHANCE_LOW)
|
||||
if(M.health > 1)
|
||||
if(main_hand)
|
||||
if(main_hand.force != 0)
|
||||
@@ -609,14 +612,14 @@
|
||||
W.attack(TARGET,src)
|
||||
sleep(1)
|
||||
else
|
||||
if(get_dist(src,TARGET) > 2)
|
||||
if(targetRange(TARGET) > 2)
|
||||
tryWalk(TARGET)
|
||||
else
|
||||
if(Adjacent(TARGET))
|
||||
M.attack_hand(src)
|
||||
sleep(1)
|
||||
timeout++
|
||||
else if(timeout >= 10 || M.health <= 1 || !(M in range(14,src)))
|
||||
else if(timeout >= 10 || M.health <= 1 || !(targetRange(M) > 14))
|
||||
doing = doing & ~FIGHTING
|
||||
timeout = 0
|
||||
TARGET = null
|
||||
@@ -665,4 +668,4 @@
|
||||
TRAITS |= TRAIT_DUMB
|
||||
faction = list("bot_grey")
|
||||
graytide = 1
|
||||
..()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user