Mercurial > nsnake
changeset 76:93d58825281a
nsnake: forgot to move scores in the middle
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 23 Mar 2020 11:36:37 +0100 |
parents | 6124d4d6746a |
children | bcf963076d94 |
files | nsnake.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/nsnake.c Mon Mar 23 11:06:42 2020 +0100 +++ b/nsnake.c Mon Mar 23 11:36:37 2020 +0100 @@ -495,6 +495,8 @@ if (s == &scores[SCORES_MAX]) return true; + /* Move the current score index to the next one. */ + memmove(&s[1], &s[0], sizeof (struct score) * (SCORES_MAX - (&s[1] - scores))); strncpy(s->name, name(), sizeof (s->name)); s->score = snake.score; s->time = time(NULL);