Hey guys,
Something really weird is happening: when I call foo(100*1.0f), somewhere along the line that becomes 0. To verify I put a breakpoint on foo(), and it indeed is zero and it indeed gets called with 100*1.0f. The code is in Obj-C++.
Here is the calling function in XCode's GDB frontend, as you can see, score*scoreMultiplier is 100.
void JNPP1PGameController::addScoreToPlayer(NSInteger score) {
if(!gameOver){
JNLogString(@"Adding score(%d*%f) to player", score, scoreMultiplier);
[player addScore: score*scoreMultiplier];
[wrapper setShouldNotify];
[wrapper notify];
} else {
JNLogString(@"Not adding score(%d*%f) because GAME IS OVAR", score, scoreMultiplier);
}
}
And here is the called function in XCode's GDB frontend, here _score is 0.
- (void) addScore:(NSInteger) _score {
score += _score;
JNLogString(@"Player can has %d points.. HURRAY!!!", score);
}