Skip to content

Importing code from clipboard into processor does not reset all state #4189

@Lonami

Description

@Lonami

Platform: Windows

Build: steam build 122.1

Issue:

  1. Place a new empty micro processor (or any of its upgraded variants).
  2. Place a message.
  3. Connect the two.
  4. With the processor selected, click on the "Edit" icon, then the "Edit..." button, then the "Import from Clipboard" button with the following contents:
set x 10
print x
printflush
  1. Observe how the message1 now displays "10".
  2. Now, repeat step 4 again but with the following contents instead:
print x
printflush
  1. Observe how the message1 still displays "10" and not "null".

I would expect all variables to be cleared after importing a new program, specially the @counter variable. I believe I'm running into issues because of this (if I paste a small program into a new processor, all is good. Large program into new, all is good. Moving from small to large causes issues, presumably because some variables were left in between).

Link(s) to mod(s) used: No mods are used.

Save file: To trigger the issue, some interaction is needed (pasting different things); the save file is a static snapshot and won't really showcase the bug. Please let me know if you would still like it though.


  • I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.
  • I have searched the closed and open issues to make sure that this problem has not already been reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions