Skip to content

Bug: Setting global variable from c# can set local variables unexpectedly #193

@joningold

Description

@joningold

This is a highly specific bug, but took me a long time to find!

if on the game side you use

story.variablesState["variable_name"] = some_value

and then also have

=== function some_function(variable_name) ===

with variable_name not actually a global variable at all, then when that function is called it will use the value "some_value", not the value passed in by the function call.

Presumably what should be done here is the global variable should be set via a method that validates that the global is indeed a global, rather than pushing into the dictionary directly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions