]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - rogue/play.c
A revision of "The purpose of computing is insight, not numbers" by
[bsdgames-darwin.git] / rogue / play.c
index c94f6e81716e23db7b21e98bead6b620bc0f2748..04f8a89fc1ae70b12927edba41cc8d4d7b4c4278 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: play.c,v 1.6 2003/08/07 09:37:39 agc Exp $     */
+/*     $NetBSD: play.c,v 1.10 2019/02/03 03:19:25 mrg Exp $    */
 
 /*
  * Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)play.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: play.c,v 1.6 2003/08/07 09:37:39 agc Exp $");
+__RCSID("$NetBSD: play.c,v 1.10 2019/02/03 03:19:25 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -56,10 +56,11 @@ __RCSID("$NetBSD: play.c,v 1.6 2003/08/07 09:37:39 agc Exp $");
 #include "rogue.h"
 
 boolean interrupted = 0;
-const char *unknown_command = "unknown command";
+
+static const char unknown_command[] = "unknown command";
 
 void
-play_level()
+play_level(void)
 {
        short ch;
        int count;
@@ -67,7 +68,7 @@ play_level()
        for (;;) {
                interrupted = 0;
                if (hit_message[0]) {
-                       message(hit_message, 1);
+                       messagef(1, "%s", hit_message);
                        hit_message[0] = 0;
                }
                if (trap_door) {
@@ -106,7 +107,7 @@ CH:
                case 'u':
                case 'n':
                case 'b':
-                       (void) one_move_rogue(ch, 1);
+                       (void)one_move_rogue(ch, 1);
                        break;
                case 'H':
                case 'J':
@@ -214,10 +215,11 @@ CH:
                        throw();
                        break;
                case 'v':
-                       message("rogue-clone: Version III. (Tim Stoehr was here), tektronix!zeus!tims", 0);
+                       messagef(0, "rogue-clone: Version III. (Tim Stoehr was here), tektronix!zeus!tims");
                        break;
                case 'Q':
                        quit(0);
+                       __unreachable();
                case '0':
                case '1':
                case '2':
@@ -246,28 +248,28 @@ CH:
                        if (wizard) {
                                inventory(&level_objects, ALL_OBJECTS);
                        } else {
-                               message(unknown_command, 0);
+                               messagef(0, "%s", unknown_command);
                        }
                        break;
                case '\023':
                        if (wizard) {
                                draw_magic_map();
                        } else {
-                               message(unknown_command, 0);
+                               messagef(0, "%s", unknown_command);
                        }
                        break;
                case '\024':
                        if (wizard) {
                                show_traps();
                        } else {
-                               message(unknown_command, 0);
+                               messagef(0, "%s", unknown_command);
                        }
                        break;
                case '\017':
                        if (wizard) {
                                show_objects();
                        } else {
-                               message(unknown_command, 0);
+                               messagef(0, "%s", unknown_command);
                        }
                        break;
                case '\001':
@@ -277,21 +279,21 @@ CH:
                        if (wizard) {
                                c_object_for_wizard();
                        } else {
-                               message(unknown_command, 0);
+                               messagef(0, "%s", unknown_command);
                        }
                        break;
                case '\015':
                        if (wizard) {
                                show_monsters();
                        } else {
-                               message(unknown_command, 0);
+                               messagef(0, "%s", unknown_command);
                        }
                        break;
                case 'S':
                        save_game();
                        break;
                default:
-                       message(unknown_command, 0);
+                       messagef(0, "%s", unknown_command);
                        break;
                }
        }