[Not a bug]Zombie sprite?

Bugs will be moved here once resolved.

Post » Sun Jan 27, 2013 1:40 pm

Link to .capx file (required!):
https://docs.google.com/file/d/0B20uobjbjbtgeFR0eldEQjN1Y2c/edit

Steps to reproduce:
1. Run the capx, press any key
2. Despite the fact that Sprite2 was destroyed on pressing a key, it will still keep adding "-"s to the textbox (forever, this is not a single cycle thing)
3. A zombie Sprite2 Object with UID 0 and its "death" instance variable = "" (empty) is the cause of the previous behavior

Observed result:
Sprites (or objects more generally) keep entering events even though they were destroyed.

Expected result:
Once destroyed sprites should not enter events.

Browsers affected:
ALL

Operating system & service pack:
Win 7 Enterprise SP1

Construct 2 version:
R116    Alcemon2013-01-27 14:49:58
B
19
S
4
G
4
Posts: 70
Reputation: 3,896

Post » Sun Jan 27, 2013 2:13 pm

There's no zombie sprite. It's just the way else works.
[quote]Else :- Run if the previous event did not run. Note that this condition does not pick any objects: if it follows an event that picks objects, in the Else event all instances revert to picked again.[/quote]
If event 2 doesn't run (there are no Sprite2 instances with death = "none") then event 3 will run. Sprite2.UID just returns 0 because there are no Sprite2s.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Sun Jan 27, 2013 2:49 pm

I see, in a more conventional programming language an exception would be raised when checking the condition on nonexistent Sprite2 instances (so we would not even reach the "else" part).

Thanks! Changing the topic title to "not a bug", hopefully it will get moved somewhere better.
B
19
S
4
G
4
Posts: 70
Reputation: 3,896


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest