marmalade / openfeint

Open Feint for Marmalade
http://openfeint.com/
8 stars 7 forks source link

Issue with updateAcheivementProgressionComplete #2

Closed OldKelevrA closed 12 years ago

OldKelevrA commented 13 years ago

Hello. I have some problems with updating the progress of achievement. When you call s3eNOFupdateAcheivementProgressionComplete there is no update progress = (

// s3eNOFAchievement ach = (s3eNOFAchievement)s3eMalloc(sizeof(s3eNOFAchievement)); if (s3eNOFachievement(ach, achievement_id) == S3E_RESULT_ERROR) { printf("error in get %s\n", achievement_id); } float new_percent = static_cast(atof(ach->percentComplete)); new_percent += percent; s3eFree(ach); if (new_percent >= 100.0f) { show_update_notification = true; } else if (new_percent < 0.0f) { return; } s3eNOFupdateAcheivementProgressionComplete(achievement_id, new_percent, show_update_notification) ; //

btw. s3eNOFachievementUnlock works good. it's means that code OFAchievement ach = [OFAchievement achievement:strAchId]; if (ach) { [ach updateProgressionComplete:updatePercentComplete andShowNotification:showUpdateNotification]; } works perfectly. I think that bug in input functions params (const char achievementId, double updatePercentComplete, bool showUpdateNotification). maby "double" problem in EDK? Any idea?

P.S. Great work.

faizann commented 12 years ago

Hi

Sorry, I didn't see email alert for this issue. Indeed double could be issue. I noticed this as well for some other API and converted to string as double is not really needed here and it doesn't cost much in terms of efficiency in this situation.

I will update code tomorrow to GIT.

faizann commented 12 years ago

Hi

I have updated code and now the updateAcheivementProgressionComplete expects string instead of double. It converts to double in the code itself. Kindly test and tell me if it all works for you.

https://github.com/marmalade/openfeint/commit/5e46206028f2eb720612dfb79eb5a79b66cd6915#diff-18