ID:142110
 
Code:
    Invert(mob/M)
var/icon/I = new(M.icon); I.MapColors(-1,0,0, 0,-1,0, 0,0,-1, 1,1,1)
var/mob/K = M.head
var/icon/H = (K.icon); H.MapColors(-1,0,0, 0,-1,0, 0,0,-1, 1,1,1)
M.icon = I
M.overlays = null
M.overlays += new H


Problem description:
runtime error: Cannot read "/mob/head/players/warrior_m_h".icon
proc name: Invert (/mob/verb/Invert)
usr: Newen (/mob/players/warrior_m)
src: Newen (/mob/players/warrior_m)
call stack:
Newen (/mob/players/warrior_m): Invert(Newen (/mob/players/warrior_m))

the mob's head is a path that leads to its predefined head and i though recreating it as K would allow me to grab its icon since i can't do M.head.icon, but that doesn't work.
and i've stared at it too long that now i can't think straight. help?
It looks like you just haven't instantiated K, it's still a type path.

var/mob/K = new M.head

It looks like M.head is a type path, not an actual object. It'd help if you turned debugging info on so you could find out which line actually has the error.

Lummox JR
In response to Lummox JR
    Invert(mob/M)
var/icon/I = new(M.icon); I.MapColors(-1,0,0, 0,-1,0, 0,0,-1, 1,1,1)
var/mob/K = new M.head
var/icon/H = new(K.icon); H.MapColors(-1,0,0, 0,-1,0, 0,0,-1, 1,1,1)
M.icon = I
M.overlays = null
K.icon = H
M.overlays += K


Thanks, this works fine :D