summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-28 16:51:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-28 16:58:39 +0300
commitb32aa4307330553e45d5a0dba149cb5fda834249 (patch)
tree82df4decc579df30c7a5010a982393a11fbc4ae8
parent92725cef35bead1b7e6b934e3861b46393b74797 (diff)
downloadevol-hercules-b32aa4307330553e45d5a0dba149cb5fda834249.tar.gz
evol-hercules-b32aa4307330553e45d5a0dba149cb5fda834249.tar.bz2
evol-hercules-b32aa4307330553e45d5a0dba149cb5fda834249.tar.xz
evol-hercules-b32aa4307330553e45d5a0dba149cb5fda834249.zip
Add empty extension object to npc.
-rw-r--r--src/Makefile.am2
-rw-r--r--src/map/data/npcd.c36
-rw-r--r--src/map/data/npcd.h12
-rw-r--r--src/map/struct/npcdext.h11
4 files changed, 61 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 514a0b7..a4956e2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,9 +34,11 @@ MAP_SRC = map/clif.c \
map/send.h \
map/data/mapd.c \
map/data/mapd.h \
+ map/data/npcd.h \
map/data/session.c \
map/data/session.h \
map/struct/mapdext.h \
+ map/struct/npcdext.h \
map/struct/sessionext.h \
map/utils/formatutils.c \
map/utils/formatutils.h \
diff --git a/src/map/data/npcd.c b/src/map/data/npcd.c
new file mode 100644
index 0000000..8d770e7
--- /dev/null
+++ b/src/map/data/npcd.c
@@ -0,0 +1,36 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../../../common/HPMi.h"
+#include "../../../common/malloc.h"
+#include "../../../common/mmo.h"
+#include "../../../common/socket.h"
+#include "../../../common/strlib.h"
+
+#include "map/data/npcd.h"
+#include "map/struct/npcdext.h"
+
+struct NpcdExt *mapd_get(npc_data *nd)
+{
+ struct NpcdExt *data = getFromNPCD(nd, 0);
+ if (!data)
+ {
+ data = mapd_create();
+ addToNPCD(nd, data, 0, true);
+ }
+ return data;
+}
+
+struct NpcdExt *mapd_create(void)
+{
+ struct NpcdExt *data = NULL;
+ CREATE(data, struct NpcdExt, 1);
+ if (!data)
+ return NULL;
+// data->x = y;
+ return data;
+}
diff --git a/src/map/data/npcd.h b/src/map/data/npcd.h
new file mode 100644
index 0000000..dacd861
--- /dev/null
+++ b/src/map/data/npcd.h
@@ -0,0 +1,12 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#ifndef EVOL_MAP_NPCD
+#define EVOL_MAP_NPCD
+
+struct NpcdExt;
+
+struct NpcdExt *npcd_get(int fd);
+struct NpcdExt *npcd_create(void);
+
+#endif // EVOL_MAP_NPCD
diff --git a/src/map/struct/npcdext.h b/src/map/struct/npcdext.h
new file mode 100644
index 0000000..11f9752
--- /dev/null
+++ b/src/map/struct/npcdext.h
@@ -0,0 +1,11 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#ifndef EVOL_MAP_NPCDEXT
+#define EVOL_MAP_NPCDEXT
+
+struct NpcdExt
+{
+};
+
+#endif // EVOL_MAP_NPCDEXT