summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorIbrahim Zidan <brahem@aotsw.com>2019-09-22 23:44:14 +0200
committerIbrahim Zidan <brahem@aotsw.com>2019-09-23 00:45:15 +0200
commit3be1dd0c728e31743c793c78ceab97b2391fb3ac (patch)
treebe51644fb992a51111040b7feeb45c11dc697431 /src/plugins
parente22d44e708d37923dcb57fd382e38b12bbc10a75 (diff)
downloadhercules-3be1dd0c728e31743c793c78ceab97b2391fb3ac.tar.gz
hercules-3be1dd0c728e31743c793c78ceab97b2391fb3ac.tar.bz2
hercules-3be1dd0c728e31743c793c78ceab97b2391fb3ac.tar.xz
hercules-3be1dd0c728e31743c793c78ceab97b2391fb3ac.zip
Fix constdb2doc pluging ignoring items in the dbmap
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/constdb2doc.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/constdb2doc.c b/src/plugins/constdb2doc.c
index 3f681ea1a..ebaf7a833 100644
--- a/src/plugins/constdb2doc.c
+++ b/src/plugins/constdb2doc.c
@@ -22,7 +22,8 @@
/// db/constants.conf -> doc/constants.md generator plugin
#include "common/hercules.h"
-//#include "common/memmgr.h"
+#include "common/db.h"
+#include "common/memmgr.h"
#include "common/nullpo.h"
#include "common/strlib.h"
#include "map/itemdb.h"
@@ -143,17 +144,26 @@ struct item_data *constdb2doc_itemdb_search(int nameid)
void constdb2doc_itemdb(void)
{
- int i;
-
nullpo_retv(out_fp);
fprintf(out_fp, "## Items (db/"DBPATH"item_db.conf)\n");
- for (i = 0; i < ARRAYLENGTH(itemdb->array); i++) {
+ for (int i = 0; i < ARRAYLENGTH(itemdb->array); i++) {
struct item_data *id = constdb2doc_itemdb_search(i);
if (id == NULL || id->name[0] == '\0')
continue;
fprintf(out_fp, "- `%s`: %d\n", id->name, id->nameid);
}
+
+ if (db_size(itemdb->other) > 0) {
+ struct DBIterator *iter = db_iterator(itemdb->other);
+ for (struct item_data *itd = dbi_first(iter); dbi_exists(iter); itd = dbi_next(iter)) {
+ if (itd == &itemdb->dummy)
+ continue;
+ fprintf(out_fp, "- `%s`: %d\n", itd->name, itd->nameid);
+ }
+ dbi_destroy(iter);
+ }
+
fprintf(out_fp, "\n");
}