TouchDown stuck after GameCenter.ShowLeaderBoard()

Monkey Forums/Monkey Bug Reports/TouchDown stuck after GameCenter.ShowLeaderBoard()

Fred(Posted 2013) [#1]
Bug found in v73b IOS (device and simulator, ioS 5 and 6)

TouchDown() still returns 1 after leaving the Game Center leaderboard.
And crashes when the next touch occurs;

if you do in OnUpdate()

if TouchHit()
GameCenter.ShowLeaderBoard()
endif

The Game Center popup is called and works. But when you leave it, the game loop is back fine but TouchDown is always set to 1. And then the next finger touch crashes in this part of monkey:

void BBIosGame::TouchesEvent( UIEvent *event ){
if( [event type]==UIEventTypeTouches ){
UIView *view=_appDelegate->view;
float scaleFactor=1.0f;
if( [view respondsToSelector:@selector(contentScaleFactor)] ){
scaleFactor=[view contentScaleFactor];
}
for( int pid=0;pid<32;++pid ){
if( _touches[pid] && _touches[pid].view!=view ) _touches[pid]=0;
}

EXC_BAD_ACCESS on the last line above

I know it's not a good iOS implementation. Buttons should be triggered when they are released according to iOS rules.

(I implemented it in the right way and the bug doesn't appear then, as the touch is released before calling the leaderboard.)


maverick69(Posted 2013) [#2]
Same bug here with Monkey v74a. Is this already fixed in the latest monkey build?


marksibly(Posted 2013) [#3]
Can you please post some runnable code?

Just tried this (adapted from GameCenter docs) and it seems to work OK on iPod/iOS6 and simulator/iOS7...