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

"Wait" causes permanent alteration to local variable declaration if another's value is set #6706

Closed
1 task done
Granshmeyr opened this issue Jun 23, 2024 · 2 comments · Fixed by #6715
Closed
1 task done

Comments

@Granshmeyr
Copy link

Granshmeyr commented Jun 23, 2024

Is there an existing issue for this?

Describe the bug

Setting the value of local variable foo in any event can permanently alter the declared value of local variable bar. The declaration of bar, even if the setting of foo is thereafter bypassed, will be permanently altered. Note that this only occurs if there is a "Wait" event after the declaration of bar.

Events preview

image

Steps to reproduce

  1. Clone https://github.com/Granshmeyr/GDevelop-LocalVariableOverwrite-MRP
  2. Run game
  3. Press space to display the value of foo
  4. Wait for the "Wait" event to elapse (2 seconds)
  5. Press space and wait again
  6. Notice how the value of foo is still "Hello World!"
  7. Press enter to enable bar setting
  8. Press space and wait again
  9. Notice how the value of foo is now equal to the set value of bar in the event sheet
  10. Press enter to disable bar setting
  11. Notice how foo is now permanently declared with the value of bar for this runtime

GDevelop platform

Desktop

GDevelop version

5.4.204

Platform info

OS (e.g. Windows, Linux, macOS, Android, iOS)
Windows

OS Version (e.g. Windows 10, macOS 10.15)
Windows 11 Home (22H2)

Browser(For Web) (e.g. Chrome, Firefox, Safari)
Not applicable

Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)
Not applicable

Additional context

The variable being overwritten only gets overwritten after the "Wait" event finishes.

@Granshmeyr Granshmeyr changed the title "Wait" causes permanent alteration to local variable declaration if another is also declared "Wait" causes permanent alteration to local variable declaration if another's value is set Jun 23, 2024
@D8H
Copy link
Collaborator

D8H commented Jun 25, 2024

Thanks a lot for reporting this issue and for the great reproduction explanations and project.
It should be fixed in the next release.

@Granshmeyr
Copy link
Author

I suppose I can close this because I can confirm it is fixed in the latest update (5.4.205).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants