Skip to content

Adds warning on var/static when it's declared with a proc in a proc #405

Description

@EvilDragonfiend

DMM should give us a warn when a static variable takes a value from a proc on var declaration

/proc/glob_foo()
    var/static/hello = another_foo()

This has a high chance to cause an issue, because hello in glob_foo() will be initialized in pre-runtime, while when another_foo() proc isn't ready to return a value properly, for example, it's a subsystem proc, the variable may not take a desired value.

This should be:

/proc/glob_foo()
    var/static/hello
    if(isnull(hello))
        hello = another_foo()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions