ID:2188467
 
Resolved
BYOND Version:510
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 56.0.2924.28
Applies to:Dream Daemon
Status: Resolved

This issue has been resolved.
Descriptive Problem Summary:
runtime error: Cannot read null.icon_size
proc name: update o (/obj/screen/parallax_layer/proc/update_o)
source file: parallax.dm,247

/obj/screen/parallax_layer/proc/update_o(view = world.view)
var/list/new_overlays = list()
var/count = Ceiling(view/480/world.icon_size) //<--- line 247
for(var/x in -count to count)
for(var/y in -count to count)
if(x == 0 && y == 0)
continue
var/image/I = image(icon, null, icon_state)
I.transform = matrix(1, 0, x*480, 0, 1, y*480)
new_overlays += I

overlays = new_overlays
view_sized = view
/proc/Ceiling(x, y=1)
return -round(-x / y) * y


I'm just gonna make a guess here, world is not suppose to be null.

Happens after world init, so it's not that, Happens in 510 and 511.1366 (with a clean compile between testing)

If I had to take a guess, it's the default arg in the proc being a world dot access. I remember there being a bug around reference dot accesses and default args.
changing it to this made the bug go away:

/obj/screen/parallax_layer/proc/update_o(view)
if (!view)
view = world.view
var/list/new_overlays = list()
var/count = Ceiling(view/480/world.icon_size)
for(var/x in -count to count)
for(var/y in -count to count)
if(x == 0 && y == 0)
continue
var/image/I = image(icon, null, icon_state)
I.transform = matrix(1, 0, x*480, 0, 1, y*480)
new_overlays += I

overlays = new_overlays
view_sized = view
Yep, it's that default arg bug again. Since I can't remember what thread that is, I'll just close this as resolved (even though the overall problem is not) so it doesn't clutter up the bug reports.
Lummox JR resolved issue
Clutter.

Interesting workaround:

Add(mob/target,time=world.time)
if(world.time-time>duration) //this line will runtime, as world is null somehow...
return 0


Add(mob/target,time=world.time)
set hidden = 0 //inserting a pointless setting will cause the runtime to no longer happen
if(world.time-time>duration)