Problem with changing app states and OnLeave actions

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 773
Joined: Wed May 05, 2010 12:16 pm

Problem with changing app states and OnLeave actions

Post by Rado1 » Wed May 14, 2014 12:34 pm

When AppState has some actions in the OnLeave section and somewhere in code is used this app state in SetAppState multiple times, the actions are not called.

It seems that OnLeave section is executed only in the case when app state is switched to another state; if application is being switched to the same state the OnLeave section is not executed. This is not a consistent behavior, because, for instance, the OnStart section is executed always. Could it be corrected and OnLeave called each time app state is switched?

As an example see the attached testing model. Just press the Space key which should switch the app state. If set to the same state AppState1, the OnLeave section is not called and the counter remains always 0. If the app state is switched to AppState2 (change the value of the SetAppState in the OnPressed section) the counter is being updated.
Attachments
test.zgeproj
testing model
(1.98 KiB) Downloaded 265 times

User avatar
VilleK
Site Admin
Posts: 2079
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed May 14, 2014 12:40 pm

Should be fixed now. Download beta again.

User avatar
Rado1
Posts: 773
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Wed May 14, 2014 12:58 pm

Tested, works perfectly. Thanks!

Post Reply