[DGD] Updated namedump patch

Raymond Jennings shentino at gmail.com
Thu Oct 8 02:07:10 CEST 2015


Hey...I noticed that if you hose up your object manager, having a list of
the names of all objects that exist can be a handy debugging tool.

Here's the patch, for anyone who wants it.

Also, dworkin...is there a chance that this or something like it could be
merged in as an optional define?

----
diff --git a/src/object.cpp b/src/object.cpp
index 6094bd9..ae8e103 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -1386,6 +1386,7 @@ void o_restore(int fd, unsigned int rlwobj, bool part)
     char *p;
     dump_header dh;
     char buffer[CHUNKSZ];
+    FILE *namedump;

     p = NULL;

@@ -1409,6 +1410,8 @@ void o_restore(int fd, unsigned int rlwobj, bool part)
     baseplane.nobjects = dh.nobjects;
     baseplane.nfreeobjs = dh.nfreeobjs;

+    namedump = fopen("../namedump", "w");
+
     /* read object names */
     buflen = 0;
     for (i = 0, o = otable; i < baseplane.nobjects; i++, o++) {
@@ -1438,6 +1441,8 @@ void o_restore(int fd, unsigned int rlwobj, bool part)
     o->chain.name = strcpy(ALLOC(char, len = strlen(p) + 1), p);
     m_dynamic();

+    fprintf(namedump, "/%s\n", p);
+
     if (o->count != 0) {
  hte **h;

@@ -1468,6 +1473,8 @@ void o_restore(int fd, unsigned int rlwobj, bool part)
  }
     }

+    fclose(namedump);
+
     o_sweep(baseplane.nobjects);

     if (part) {



More information about the DGD mailing list