Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
EvilDragonfiend opened this issue Aug 12, 2024 · 0 comments
Open

Comments

@EvilDragonfiend
Copy link

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants