* ;Goto floor now goes to first KNOWN room, or first room only if no known
authorMichael Hampton <io_error@uncensored.citadel.org>
Thu, 26 Feb 2004 22:03:24 +0000 (22:03 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Thu, 26 Feb 2004 22:03:24 +0000 (22:03 +0000)
  rooms on the floor

citadel/ChangeLog
citadel/citadel.c

index 7b7d000676ea32e01b7bdcfbec5ef3beef64ec59..858b5acf8225c33a509da9c542471858c4d0ad8c 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 614.53  2004/02/26 22:03:24  error
+ * ;Goto floor now goes to first KNOWN room, or first room only if no known
+   rooms on the floor
+
  Revision 614.52  2004/02/26 20:30:36  error
  * Populate IPC into a few more places to avoid a nasty crash at MORE prompt
 
@@ -5413,4 +5417,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index d31c8ae2d2260fd73a812f1d91f1a040947f76d0..c5afd3959c73d70f07a1f5f28270f829f824bdc2 100644 (file)
@@ -626,6 +626,30 @@ void gotofloor(CtdlIPC *ipc, char *towhere, int mode)
                return;
        }
 
+       /* Find first known room on the floor */
+
+       strcpy(targ, "");
+       mptr = NULL;
+       r = CtdlIPCKnownRooms(ipc, SubscribedRooms, tofloor, &mptr, buf);
+       if (r / 100 == 1) {
+               struct march *tmp = mptr;
+
+               /* TODO: room order is being ignored? */
+               if (mptr)
+                       strncpy(targ, mptr->march_name, ROOMNAMELEN);
+               while (mptr) {
+                       tmp = mptr->next;
+                       free(mptr);
+                       mptr = tmp;
+               }
+       }
+       if (strlen(targ) > 0) {
+               gf_toroom(ipc, targ, mode);
+               return;
+       }
+
+       /* No known rooms on the floor; unzap the first one then */
+
        strcpy(targ, "");
        mptr = NULL;
        r = CtdlIPCKnownRooms(ipc, AllAccessibleRooms, tofloor, &mptr, buf);