ID:169691
 
I'm trying to add a screen obj to a list by doing this:

obj/myobj
New(client/C) screen_loc = "19,3", C.screen+=src

proc/All()
var/obj/myobj/O = new
mylist += O


But it's calling O's new() proc and in effect I get a runtime error saying cannot modify null.screen. I know what's causing this but how should I add them to a list?
I think something like:
obj/myobj
New(client/C) screen_loc = "19,3", C.screen+=src
mob/verb/hud()
set name="Hud-a-tize-me, Capn'!"
var/obj/myobj/O = new(client)
mylist += O


Would work. =/
In response to Hell Ramen
Not really because I dont want the obj thats created to go into anyone's screen at that point. I just want it in a list.
In response to DeathAwaitsU
Maybe:
obj/myobj
New(client/C)
if(!C)return ..()
screen_loc = "19,3", C.screen+=src


=/
In response to Hell Ramen
Ungh cant believe I didn't think that. Thanks.