"Wait" causes permanent alteration to local variable declaration if another's value is set
Is there an existing issue for this?
- [x] I have searched the existing issues
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
Steps to reproduce
- Clone https://github.com/Granshmeyr/GDevelop-LocalVariableOverwrite-MRP
- Run game
- Press space to display the value of
foo - Wait for the "Wait" event to elapse (2 seconds)
- Press space and wait again
- Notice how the value of
foois still"Hello World!" - Press enter to enable
barsetting - Press space and wait again
- Notice how the value of
foois now equal to the set value ofbarin the event sheet - Press enter to disable
barsetting - Notice how
foois now permanently declared with the value ofbarfor 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.
Thanks a lot for reporting this issue and for the great reproduction explanations and project. It should be fixed in the next release.
I suppose I can close this because I can confirm it is fixed in the latest update (5.4.205).