ID:2112538
 
Code:
proc/in_range(source, user)
if(get_dist(source, user) <= 1)
return 1

return 0 //not in range and not telekinetic


code\__HELPERS\game.dm:47:error: bad argument definition


Anyone know how to fix this?


what r u using as ur arguments
In response to Zagros5000
I have no idea honestly
In response to Heffy117
what are you using as the source and user?
when you call the proc in_range(what goes here, and what goes here)

ideally you would just have to do in_range(urself,the other person/object)
get_dist() expects atoms as arguments.
proc/in_range(mob/source, mob/user)

Edit: Also, you only need one argument here.
mob/proc/in_distance(mob/target)
if(get_dist(src, target) <= 1)
//Your stuff
In response to GreatPirateEra
GreatPirateEra wrote:
get_dist() expects mobs as arguments.

No, it doesn't.

The Ref wrote:
get_dist(Loc1,Loc2)
Loc1: An object on the map.
Loc2: An object on the map.

It works with any atom but an area (so turfs, mobs, objects)
In response to CrimsonVision
Welp.