Goto Without Goto.

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 10/22/97


diff -upPr -x *.o ../stk/interpreter.c ./interpreter.c
--- ../stk/interpreter.c        Fri Apr 12 23:39:21 1996
+++ ./interpreter.c     Wed Oct 22 15:43:11 1997
@@ -581,12 +581,21 @@ void command_interpreter(struct char_dat
    * requested by many people so "'hi" or ";godnet test" is possible.
    * Patch sent by Eric Green and Stefan Wasilewski.
    */
-  if (!isalpha(*argument)) {
+  if (!isalpha(*argument) && !isdigit(*argument)) {
     arg[0] = argument[0];
     arg[1] = '\0';
     line = argument + 1;
   } else
     line = any_one_arg(argument, arg);
+
+  /*
+   * If someone just typed a number, then put that number in the argument
+   * and put 'goto' in the command string. -gg
+   */
+  if (GET_LEVEL(ch) >= LVL_IMMORT && isdigit(*arg)) {
+    strcpy(line, arg);
+    strcpy(arg, "goto");
+  }

   /* otherwise, find the command */
   for (length = strlen(arg), cmd = 0; *cmd_info[cmd].command != '\n'; cmd++)


This is the same idea as a feature of my MUD, you type just a number '1204'
and you go there, except I reworked it to go through the command parser so
that you can't goto while frozen.

'3000' = 'goto 3000'

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST