summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-01-19 02:58:36 -0200
committershennetsind <ind@henn.et>2014-01-19 02:58:36 -0200
commitacc992ac2838f6380ebf2b2f8a514e86c2b750d9 (patch)
tree9d06366b015de60c71280f92c48fadb024e04a0f /src/map/guild.c
parentc32a22c52b75ae8c3bc2064110318f4ad1d6954a (diff)
downloadhercules-acc992ac2838f6380ebf2b2f8a514e86c2b750d9.tar.gz
hercules-acc992ac2838f6380ebf2b2f8a514e86c2b750d9.tar.bz2
hercules-acc992ac2838f6380ebf2b2f8a514e86c2b750d9.tar.xz
hercules-acc992ac2838f6380ebf2b2f8a514e86c2b750d9.zip
HPM Custom Data Struct Expansion: map/instance/party/guild
As requested by the community in http://hercules.ws/board/topic/3832-hpm-custom-data-struct-for-instance-data-guild-data-and-party-data/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 909c360a8..d13c681bb 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -11,6 +11,7 @@
#include "../common/ers.h"
#include "../common/strlib.h"
#include "../common/utils.h"
+#include "../common/HPM.h"
#include "map.h"
#include "guild.h"
@@ -1758,6 +1759,16 @@ int guild_broken(int guild_id,int flag)
}
if( g->instance )
aFree(g->instance);
+
+ for( i = 0; i < g->hdatac; i++ ) {
+ if( g->hdata[i]->flag.free ) {
+ aFree(g->hdata[i]->data);
+ }
+ aFree(g->hdata[i]);
+ }
+ if( g->hdata )
+ aFree(g->hdata);
+
idb_remove(guild->db,guild_id);
return 0;
}
@@ -2228,6 +2239,7 @@ void do_init_guild(bool minimal) {
void do_final_guild(void) {
DBIterator *iter = db_iterator(guild->db);
struct guild *g;
+ int i;
for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) ) {
if( g->channel != NULL )
@@ -2236,6 +2248,14 @@ void do_final_guild(void) {
aFree(g->instance);
g->instance = NULL;
}
+ for( i = 0; i < g->hdatac; i++ ) {
+ if( g->hdata[i]->flag.free ) {
+ aFree(g->hdata[i]->data);
+ }
+ aFree(g->hdata[i]);
+ }
+ if( g->hdata )
+ aFree(g->hdata);
}
dbi_destroy(iter);