summaryrefslogtreecommitdiff
path: root/src/map/party.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/party.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/party.c')
-rw-r--r--src/map/party.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 7af6acff5..9f144297d 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -11,6 +11,7 @@
#include "../common/showmsg.h"
#include "../common/utils.h"
#include "../common/strlib.h"
+#include "../common/HPM.h"
#include "party.h"
#include "atcommand.h" //msg_txt()
@@ -94,8 +95,21 @@ TBL_PC* party_sd_check(int party_id, int account_id, int char_id) {
int party_db_final(DBKey key, DBData *data, va_list ap) {
struct party_data *p;
- if( ( p = DB->data2ptr(data) ) && p->instance )
- aFree(p->instance);
+ if( ( p = DB->data2ptr(data) ) ) {
+ int j;
+
+ if( p->instance )
+ aFree(p->instance);
+
+ for( j = 0; j < p->hdatac; j++ ) {
+ if( p->hdata[j]->flag.free ) {
+ aFree(p->hdata[j]->data);
+ }
+ aFree(p->hdata[j]);
+ }
+ if( p->hdata )
+ aFree(p->hdata);
+ }
return 0;
}
@@ -591,6 +605,15 @@ int party_broken(int party_id)
if( p->instance )
aFree(p->instance);
+
+ for( j = 0; j < p->hdatac; j++ ) {
+ if( p->hdata[j]->flag.free ) {
+ aFree(p->hdata[j]->data);
+ }
+ aFree(p->hdata[j]);
+ }
+ if( p->hdata )
+ aFree(p->hdata);
idb_remove(party->db,party_id);
return 0;