From 09e154b0687a2ba69d5ce6f2456c61db86bc4dec Mon Sep 17 00:00:00 2001 From: zephyrus Date: Wed, 12 Aug 2009 21:44:02 +0000 Subject: - Optimization to instance system. * Removed the crc feature to generate instance npc names. The instance npc name will be "dup_" + instanceid + "_" + srcnpcid. * Removed the big array under map structure and coded in a different way. It was only used to generate map names, but i just used the instance_id + "origin map name". * Moved all instance features to separated files. * Moved the npc duplication for instances into npc.c as Ultramage says (removed npcname_db from npc.h). * Added recomendations for scripts commands by Saithis. - Testing required, i will prepare Endless Tower script soon. I hope this do almost anything in bugreport 3276. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14003 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/party.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/map/party.c') diff --git a/src/map/party.c b/src/map/party.c index a7e6758e4..4a10036d3 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -14,6 +14,7 @@ #include "atcommand.h" //msg_txt() #include "pc.h" #include "map.h" +#include "instance.h" #include "battle.h" #include "intif.h" #include "clif.h" @@ -540,7 +541,7 @@ int party_member_leaved(int party_id, int account_id, int char_id) clif_charnameupdate(sd); //Update name display [Skotlex] //TODO: hp bars should be cleared too if( p->instance_id ) - map_instance_check_kick(sd); + instance_check_kick(sd); } return 0; @@ -559,15 +560,18 @@ int party_broken(int party_id) if( p->instance_id ) { instance[p->instance_id].party_id = 0; - map_instance_destroy( p->instance_id ); + instance_destroy( p->instance_id ); } - for(i=0;idata[i].sd!=NULL){ + for( i = 0; i < MAX_PARTY; i++ ) + { + if( p->data[i].sd!=NULL ) + { clif_party_leaved(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10); p->data[i].sd->status.party_id=0; } } + idb_remove(party_db,party_id); return 0; } -- cgit v1.2.3-60-g2f50