OpenDream icon indicating copy to clipboard operation
OpenDream copied to clipboard

Runtime trying to get `overlays` from an `IconAppearance`

Open ike709 opened this issue 1 year ago • 0 comments

Exception:

[17:38:29] Runtime in code/controllers/subsystem/overlays.dm,92: Invalid appearance var "overlays"
  Exception occurred: Invalid appearance var "overlays"

  =DM StackTrace=

   /atom/copy_overlays code/controllers/subsystem/overlays.dm:92

   set_dynamic_human_appearance code/__HELPERS/dynamic_human_icon_gen.dm:62

   apply_dynamic_human_appearance code/__HELPERS/dynamic_human_icon_gen.dm:54

  =C# StackTrace=

  System.Exception: Invalid appearance var "overlays"

   at OpenDreamRuntime.Procs.DMProcState.ThrowInvalidAppearanceVar(String field) in C:\Users\Ike\Documents\GitHub\OpenDream\OpenDream\OpenDreamRuntime\Procs\DMProc.cs:line 911

   at OpenDreamRuntime.Procs.DMProcState.DereferenceField(DreamValue owner, String field) in C:\Users\Ike\Documents\GitHub\OpenDream\OpenDream\OpenDreamRuntime\Procs\DMProc.cs:line 893

   at OpenDreamRuntime.Procs.DMOpcodeHandlers.PushReferenceAndDereferenceField(DMProcState state) in C:\Users\Ike\Documents\GitHub\OpenDream\OpenDream\OpenDreamRuntime\Procs\DMOpcodeHandlers.cs:line 2912

   at OpenDreamRuntime.Procs.DMProcState.Resume() in C:\Users\Ike\Documents\GitHub\OpenDream\OpenDream\OpenDreamRuntime\Procs\DMProc.cs:line 433

   at OpenDreamRuntime.DreamThread.Resume() in C:\Users\Ike\Documents\GitHub\OpenDream\OpenDream\OpenDreamRuntime\DreamThread.cs:line 236

Code (from TG):

/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom
	if(!other)
		if(cut_old)
			cut_overlays()
		return

	STAT_START_STOPWATCH
	var/list/cached_other = other.overlays.Copy()
	if(cut_old)
		if(cached_other)
			overlays = cached_other
		else
			overlays = null
		VALIDATE_OVERLAY_LIMIT(src)
		POST_OVERLAY_CHANGE(src)
		STAT_STOP_STOPWATCH
		STAT_LOG_ENTRY(SSoverlays.stats, type)
	else if(cached_other)
		overlays += cached_other
		VALIDATE_OVERLAY_LIMIT(src)
		POST_OVERLAY_CHANGE(src)
		STAT_STOP_STOPWATCH
		STAT_LOG_ENTRY(SSoverlays.stats, type)

Note: image

ike709 avatar Aug 07 '24 23:08 ike709