range proc not working properly in Developer Help
|
|
proc/Update_Radar() for(var/client/C) if(C.radar) var/icon/R = icon('minimap.dmi',"M") for(var/turf/M in range(20,C.mob)) if(M.density == 1) if(M.icon_state == "tree") if(get_dist(C.mob,M) < 20 && C.mob.z == M.z && C.mob != M) var/x = 16-(C.mob.x - M.x) var/y = 16-(C.mob.y - M.y) R.DrawBox(rgb(0,255,0), x, y, x, y) else if(get_dist(C.mob,M) < 20 && C.mob.z == M.z && C.mob != M) var/x = 16-(C.mob.x - M.x) var/y = 16-(C.mob.y - M.y) R.DrawBox(rgb(0,255,255), x, y, x, y) for(var/mob/BlackSmith/M in range(20,C.mob)) if(get_dist(C.mob,M) < 20 && C.mob.z == M.z && C.mob != M) var/x = 16-(C.mob.x - M.x) var/y = 16-(C.mob.y - M.y) R.DrawBox(rgb(255,0,0), x-1, y-1, x+1, y+1) for(var/mob/ShopKeeper/M in range(20,C.mob)) if(get_dist(C.mob,M) < 20 && C.mob.z == M.z && C.mob != M) var/x = 16-(C.mob.x - M.x) var/y = 16-(C.mob.y - M.y) R.DrawBox(rgb(255,0,0), x-1, y-1, x+1, y+1) C.radar.icon = R spawn(5) Update_Radar()
|
What this code does is updates a minimap, this is just the radar demo edited, BUT for some reason, all the "for(var/turf/M in range(20,C.mob))" doesn't get all all the atoms in a range of 20, it only gets all the atoms in a range of about 10, anyone know why or how I can work around this?
Edit: The only way I can get this to work is to use "in world" which lags my game to much.
|
Lummox JR