OpenDreamProject / OpenDream

A project for running games made in the DM programming language
MIT License
200 stars 109 forks source link

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

Open ike709 opened 1 month ago

ike709 commented 1 month ago

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