[ScryMUD] SVN Commit Info r858 - trunk/mud/grrmud/server

scrymud at wanfear.com scrymud at wanfear.com
Mon Feb 5 00:05:50 PST 2007


Author: eroper
Date: 2007-02-05 00:05:49 -0800 (Mon, 05 Feb 2007)
New Revision: 858

Modified:
   trunk/mud/grrmud/server/gen_cmds.spec
   trunk/mud/grrmud/server/misc.cc
   trunk/mud/grrmud/server/misc.h
Log:
Partially addresses MUD-388
Adds two new Immortal commands: mia_objects, mia_mobs
These commands report defined mobs/objects with a cur_in_game count of 0.


Modified: trunk/mud/grrmud/server/gen_cmds.spec
===================================================================
--- trunk/mud/grrmud/server/gen_cmds.spec	2007-02-03 23:39:39 UTC (rev 857)
+++ trunk/mud/grrmud/server/gen_cmds.spec	2007-02-05 08:05:49 UTC (rev 858)
@@ -522,6 +522,10 @@
 return mclear(i, pc);
 mclone ~
 return mclone(i, &(cooked_strs[1]), pc);
+mia_mobs ~
+return mia_mobs(i, pc);
+mia_objects ~
+return mia_objects(i, pc);
 mldsearch ~
 return mldsearch(&(cooked_strs[1]), pc);
 mlist ~

Modified: trunk/mud/grrmud/server/misc.cc
===================================================================
--- trunk/mud/grrmud/server/misc.cc	2007-02-03 23:39:39 UTC (rev 857)
+++ trunk/mud/grrmud/server/misc.cc	2007-02-05 08:05:49 UTC (rev 858)
@@ -3279,3 +3279,53 @@
    }//while there are more rooms.
    return(0);
 }//verifydoors()
+
+int mia_mobs(int i_th, critter &pc) {
+    /* mia_mobs prints out a list of all mobs which are defined in the World
+     * DB but are not currently in game. In theory we can extend this later to
+     * use i_th to limit the output to mobs from zone #i_th.
+     */
+    int i;
+    String buf;
+
+    if (! ok_to_do_action(NULL, "I", 0, pc, pc.getCurRoom(), NULL, TRUE)) {
+        return -1;
+    }
+
+    pc.show("^RThe following MOBs are missing from the game:^0\n");
+    for( i=0; i<NUMBER_OF_MOBS+1; i++ ) {
+        if ( mob_list[i].isInUse() ) {
+            if ( mob_list[i].mob->getCurInGame() == 0 ) {
+                Sprintf(buf,"^B[%d] %S^0\n", i, mob_list[i].getName());
+                pc.show(buf);
+            }
+        }//isInUse()
+    }//for
+    pc.show("^REnd of list.^0\n");
+    return(0);
+}//mia_mobs()
+
+int mia_objects(int i_th, critter &pc) {
+    /* mia_objects prints out a list of all objects which are defined in the
+     * World DB but are not currently in game. In theory we can extend this
+     * later to use i_th to limit the output to objects from zone #i_th.
+     */
+    int i;
+    String buf;
+
+    if (! ok_to_do_action(NULL, "I", 0, pc, pc.getCurRoom(), NULL, TRUE)) {
+        return -1;
+    }
+
+    pc.show("^RThe following OBJs are missing from the game:^0\n");
+    for( i=0; i<NUMBER_OF_ITEMS+1; i++ ) {
+        if ( obj_list[i].isInUse() ) {
+            if ( obj_list[i].getCurInGame() == 0 ) {
+                Sprintf(buf,"^B[%d] %S^0\n", i, obj_list[i].getLongName());
+                pc.show(buf);
+            }
+        }//isInUse()
+    }//for
+    pc.show("^REnd of list.^0\n");
+    return(0);
+}//mia_objects()

Modified: trunk/mud/grrmud/server/misc.h
===================================================================
--- trunk/mud/grrmud/server/misc.h	2007-02-03 23:39:39 UTC (rev 857)
+++ trunk/mud/grrmud/server/misc.h	2007-02-05 08:05:49 UTC (rev 858)
@@ -189,6 +189,8 @@
 void do_mini_tick(); //every round of battle....
 bool isNightTime();
 int verifydoors(int i_th, critter &pc);
+int mia_mobs(int i_th, critter &pc);
+int mia_objects(int i_th, critter &pc);
 
 String *colorize(const char *input, critter &pc, hilite_type hl_type); 
 




More information about the ScryMUD mailing list