From acc992ac2838f6380ebf2b2f8a514e86c2b750d9 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 19 Jan 2014 02:58:36 -0200 Subject: 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 --- src/map/HPMmap.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/map/HPMmap.c') diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c index 9c09a7ad1..4b1338b8d 100644 --- a/src/map/HPMmap.c +++ b/src/map/HPMmap.c @@ -46,7 +46,7 @@ struct HPM_atcommand_list { struct HPM_atcommand_list *atcommand_list = NULL; unsigned int atcommand_list_items = 0; -void HPM_map_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) { +bool HPM_map_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) { /* record address */ switch( type ) { case HPDT_MSD: @@ -57,11 +57,26 @@ void HPM_map_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataType ret->HPDataSRCPtr = (void**)(&((struct npc_data *)ptr)->hdata); ret->hdatac = &((struct npc_data *)ptr)->hdatac; break; + case HPDT_MAP: + ret->HPDataSRCPtr = (void**)(&((struct map_data *)ptr)->hdata); + ret->hdatac = &((struct map_data *)ptr)->hdatac; + break; + case HPDT_PARTY: + ret->HPDataSRCPtr = (void**)(&((struct party_data *)ptr)->hdata); + ret->hdatac = &((struct party_data *)ptr)->hdatac; + break; + case HPDT_GUILD: + ret->HPDataSRCPtr = (void**)(&((struct guild *)ptr)->hdata); + ret->hdatac = &((struct guild *)ptr)->hdatac; + break; + case HPDT_INSTANCE: + ret->HPDataSRCPtr = (void**)(&((struct instance_data *)ptr)->hdata); + ret->hdatac = &((struct instance_data *)ptr)->hdatac; + break; default: - ret->HPDataSRCPtr = NULL; - ret->hdatac = NULL; - return; + return false; } + return true; } void HPM_map_plugin_load_sub(struct hplugin *plugin) { -- cgit v1.2.3-70-g09d2