From b32aa4307330553e45d5a0dba149cb5fda834249 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Nov 2014 16:51:09 +0300 Subject: Add empty extension object to npc. --- src/map/data/npcd.c | 36 ++++++++++++++++++++++++++++++++++++ src/map/data/npcd.h | 12 ++++++++++++ src/map/struct/npcdext.h | 11 +++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/map/data/npcd.c create mode 100644 src/map/data/npcd.h create mode 100644 src/map/struct/npcdext.h (limited to 'src/map') 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 +#include +#include + +#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 -- cgit v1.2.3-70-g09d2