ID:262372
 
I have modified the radar to now pick up DRAGON BALLs. It was working until I recently edited a bit. Now when I call Update_Radar() the game freezes.
mob/proc/Update_Radar()
while(src.radar) // Loop through all non-npc players...
if(src.radar)
var/icon/R = icon('Radar_Blips.dmi',"Radar") // Create an icon to draw on
R.DrawBox(rgb(0,128,0),0,0,32,32) // Clear the radar icon with a dark-ish green
R.DrawBox(rgb(255,255,255), 17, 17-3, 17, 17+3)
R.DrawBox(rgb(255,255,255), 17-3, 17, 17+3, 17)
for(var/obj/Dragon_Balls/Earth/D in world) // Search through all of the mobs...
if(get_dist(src,D) < 400 && src.z == D.z) // If the mob is within 10 squares of the player, is on the same z level, and isn't itself (don't want to place yourself on it, do you?)
var/x = 16-(src.x - D.x)+1
var/y = 16-(src.y - D.y)+1
R.DrawBox(D.team, x-1, y-1, x+1, y+1) // Draw the blip at the proper x/y coordinates

src.radar.icon = R // Set the new icon onto the radar
spawn(5)
Update_Radar()
The game is freezing because you're in a while() loop without sleeping. You should remove that useless if() statement too, since it does nothing; the while() loop already answers the same question.

Lummox JR
Also, x & y are built in area, turf, obj, and mob vars, so that may confuse the game-run thingie or something.