X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=score.c;h=7e6b28c26ae9ee02a96f3d596983f39a6abae393;hb=9a1b4d021e360c48e3fb885a9975077063f8e012;hp=4331f7f93bfecd6485eaa71e2c8fef1730a71c8e;hpb=ff2dd31209cac24dc26abbe6146158de62393fec;p=open-adventure.git diff --git a/score.c b/score.c index 4331f7f..7e6b28c 100644 --- a/score.c +++ b/score.c @@ -126,13 +126,16 @@ void terminate(enum termination mode) for (int i = 1; i <= (int)NCLASSES; i++) { if (classes[i].threshold >= points) { speak(classes[i].message); - int nxt = classes[i].threshold + 1 - points; - rspeak(NEXT_HIGHER, nxt, nxt); + if (i < (int)NCLASSES) { + int nxt = classes[i].threshold + 1 - points; + rspeak(NEXT_HIGHER, nxt, nxt); + } else { + rspeak(NO_HIGHER); + } exit(EXIT_SUCCESS); } } rspeak(OFF_SCALE); - rspeak(NO_HIGHER); exit(EXIT_SUCCESS); }