Browse code

only accept better score

devnewton authored on 06/01/2012 at 10:41:49
Showing 1 changed files
... ...
@@ -28,7 +28,7 @@ def score(request):
28 28
         return HttpResponse("invalid player secret")
29 29
     score, isNewScore = Score.objects.get_or_create( level = level, player = player, defaults={'score':request.REQUEST['score']} )
30 30
     if not isNewScore:
31
-        score.score = request.REQUEST['score']
31
+        score.score = max( int( request.REQUEST['score'] ), int( score.score ) )
32 32
         score.save()
33 33
     #cleanup
34 34
     level.cleanup()