summaryrefslogtreecommitdiff
path: root/src/map
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 /src/map
parent92725cef35bead1b7e6b934e3861b46393b74797 (diff)
downloadplugin-b32aa4307330553e45d5a0dba149cb5fda834249.tar.gz
plugin-b32aa4307330553e45d5a0dba149cb5fda834249.tar.bz2
plugin-b32aa4307330553e45d5a0dba149cb5fda834249.tar.xz
plugin-b32aa4307330553e45d5a0dba149cb5fda834249.zip
Add empty extension object to npc.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/data/npcd.c36
-rw-r--r--src/map/data/npcd.h12
-rw-r--r--src/map/struct/npcdext.h11
3 files changed, 59 insertions, 0 deletions
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