Global objects are duplicated after loading the savefile

Bugs will be moved here once resolved.

Post » Thu Feb 12, 2015 1:42 am

Problem Description
An object set as global on a layout will create duplicates of itself when revisiting that layout after saving and reloading the game from a different layout.

Attach a Capx
bug related with global object and saving.capx


Description of Capx
This capx has 2 layouts:
Layout 1 has 2 buttons for loading and saving.
Layout 2 has a global object (orange square sprite).

Steps to Reproduce Bug
  • 1) Launch the game. You'll see Layout A. Counted object = 0.
  • 2) Press Spacebar. You'll be switch to Layout B, and see the orange sprite (global object). Counted object = 1
  • 3) Press Spacebar again. You'll be switch to Layout A. The orange sprite is still present. Counted object = 1
  • 4) Press Save.
  • 5) Close the game and restart it. The orange sprite is gone. Counted object = 0.
  • 6) Press Load. The orange sprite is visible. Counted object = 1.
  • 7) Press Spacebar. You'll be switched to Layout B. Counted object = 2.
  • 8) You can repeat steps # 3 to 7 to create multiple copies of the global object.

Observed Result
The orange square global object is duplicated after loading the savefile and revisiting its layout.

Expected Result
The orange object is not duplicated after loading the savefile. No new copies of the object gets created.

Affected Browsers
  • Chrome: YES
  • FireFox: ???
  • Internet Explorer: ???

Operating System and Service Pack
Windows 7

Construct 2 Version ID
Release 195 (64-bit) - Jan 19 2015
You do not have the required permissions to view the files attached to this post.
B
18
S
5
Posts: 79
Reputation: 1,336

Post » Mon Feb 16, 2015 7:32 pm

Thanks, should be fixed in the next build.
Scirra Founder
B
383
S
225
G
86
Posts: 24,139
Reputation: 190,611

Post » Tue Feb 17, 2015 2:34 am

Oh wow, thanks! I was somehow expecting that it would be considered a normal/expected behavior for Construct, especially since I found a way to prevent this issue with some additional code. But yeah, thanks for the fix. It will make the code so much more clean! :)
B
18
S
5
Posts: 79
Reputation: 1,336


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests