X_Minimap

by Fat Albert
A detailed minimap code
ID:2176412
 
Line #: Opinion
1. instead of new init it upon world/New().
31. declare the variable above the for statement, not in it.
36. declare the variable above the for statement, not in it.
39. same as above as you're constantly remaking the variable.
40. same as above.
44. same
46. same
47. same
52. same
61. same as 36 & 31

You get the picture. You should see a bit of a difference with these changes in performance ;)
Also the mob's variables for this don't seem to be marked tmp so they could end up getting saved by accident.
I also get this error when clicking on the map to paint spots on the minimap, after I already did so.

runtime error: Cannot execute null.OverPut().
proc name: Click (/obj/WorldMap/Click)
source file: x_minimap.dm,141
usr: Kozuma3 (/mob)
src: WorldMap (/obj/WorldMap)
usr.loc: Cliff (44,38,1) (/turf/UnderWater/Cliff)
src.loc: null
call stack:
WorldMap (/obj/WorldMap): Click(null, "mapwindow.map", "icon-x=1;icon-y=24;left=1;scre...")
Ive updated the code.. declaring all variables before the loop and I got rid of the white background