diff options
author | Haru <haru@dotalux.com> | 2020-06-28 00:27:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-28 00:27:48 +0200 |
commit | f6f8ec5e247d3cd52598f2d026524d1bbc791120 (patch) | |
tree | bd6c43bdfbe4758104e74b98f8a97691a078c028 /src | |
parent | 9b89425550094f51d633e5b5d6e86af65bffbf39 (diff) | |
parent | a4492b60cf9012e990233ff4689cbf1ef67274ba (diff) | |
download | hercules-f6f8ec5e247d3cd52598f2d026524d1bbc791120.tar.gz hercules-f6f8ec5e247d3cd52598f2d026524d1bbc791120.tar.bz2 hercules-f6f8ec5e247d3cd52598f2d026524d1bbc791120.tar.xz hercules-f6f8ec5e247d3cd52598f2d026524d1bbc791120.zip |
Merge pull request #2732 from Kenpachi2k13/instance_create_doc
Update instancing window display and documentation of instance_create() script command
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 13 | ||||
-rw-r--r-- | src/map/guild.c | 13 | ||||
-rw-r--r-- | src/map/instance.c | 4 | ||||
-rw-r--r-- | src/map/party.c | 6 |
4 files changed, 28 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 649df3e33..eeb56ce0b 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11067,6 +11067,19 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) #if PACKETVER >= 20090218 quest->questinfo_refresh(sd); // NPC quest/event icon check. [Kisuka] #endif + + if (first_time) { + int i; + + ARR_FIND(0, instance->instances, i, instance->list[i].owner_type == IOT_CHAR && instance->list[i].owner_id == sd->status.account_id); + + if (i < instance->instances) { + sd->instances = 1; + CREATE(sd->instance, short, 1); + sd->instance[0] = instance->list[i].id; + clif->instance_join(sd->fd, instance->list[i].id); + } + } } /// Server's tick (ZC_NOTIFY_TIME). diff --git a/src/map/guild.c b/src/map/guild.c index 90f870f1c..a78ea169c 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -887,6 +887,12 @@ static void guild_member_joined(struct map_session_data *sd) channel->join(g->channel, sd, "", true); } + for (int j = 0; j < g->instances; j++) { + if (g->instance[j] >= 0) { + clif->instance_join(sd->fd, g->instance[j]); + break; + } + } } } @@ -940,6 +946,13 @@ static int guild_member_added(int guild_id, int account_id, int char_id, int fla channel->join(g->channel, sd, "", true); } + for (int i = 0; i < g->instances; i++) { + if (g->instance[i] >= 0) { + clif->instance_join(sd->fd, g->instance[i]); + break; + } + } + return 0; } diff --git a/src/map/instance.c b/src/map/instance.c index 1104b7e88..d2c0a229c 100644 --- a/src/map/instance.c +++ b/src/map/instance.c @@ -68,7 +68,7 @@ static bool instance_is_valid(int instance_id) /*-------------------------------------- * name : instance name * Return value could be - * -4 = already exists | -3 = no free instances | -2 = owner not found | -1 = invalid type + * -4 = already exists | -2 = owner not found | -1 = invalid type * On success return instance_id *--------------------------------------*/ static int instance_create(int owner_id, const char *name, enum instance_owner_type type) @@ -734,7 +734,7 @@ static void instance_force_destroy(struct map_session_data *sd) switch (instance->list[i].owner_type) { case IOT_CHAR: { - if (instance->list[i].owner_id != sd->status.char_id) + if (instance->list[i].owner_id != sd->status.account_id) continue; break; } diff --git a/src/map/party.c b/src/map/party.c index 8eeae2215..a6f6b7774 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -353,8 +353,6 @@ static int party_recv_info(const struct party *sp, int char_id) clif->party_info(p,NULL); for( j = 0; j < p->instances; j++ ) { if( p->instance[j] >= 0 ) { - if( instance->list[p->instance[j]].idle_timer == INVALID_TIMER && instance->list[p->instance[j]].progress_timer == INVALID_TIMER ) - continue; clif->instance_join(sd->fd, p->instance[j]); break; } @@ -488,8 +486,6 @@ static void party_member_joined(struct map_session_data *sd) p->data[i].sd = sd; for( j = 0; j < p->instances; j++ ) { if( p->instance[j] >= 0 ) { - if( instance->list[p->instance[j]].idle_timer == INVALID_TIMER && instance->list[p->instance[j]].progress_timer == INVALID_TIMER ) - continue; clif->instance_join(sd->fd, p->instance[j]); break; } @@ -551,8 +547,6 @@ static int party_member_added(int party_id, int account_id, int char_id, int fla for( j = 0; j < p->instances; j++ ) { if( p->instance[j] >= 0 ) { - if( instance->list[p->instance[j]].idle_timer == INVALID_TIMER && instance->list[p->instance[j]].progress_timer == INVALID_TIMER ) - continue; clif->instance_join(sd->fd, p->instance[j]); break; } |