summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-09-28 12:49:34 -0300
committershennetsind <ind@henn.et>2013-09-28 12:49:34 -0300
commite4b0f270ad0fabab869c1a803fa8e4a73f198760 (patch)
tree45f5f5f40e85f2d10e20ca55f6148accfe954a33 /src/map/clif.c
parent3c006ce2b772ae0dffc5fccaee6e547bf0423565 (diff)
downloadhercules-e4b0f270ad0fabab869c1a803fa8e4a73f198760.tar.gz
hercules-e4b0f270ad0fabab869c1a803fa8e4a73f198760.tar.bz2
hercules-e4b0f270ad0fabab869c1a803fa8e4a73f198760.tar.xz
hercules-e4b0f270ad0fabab869c1a803fa8e4a73f198760.zip
HPM: Instance.c Completed
Moved missing vars and declarations of interest into the interface. Instance data now available to plugins via instance->list (struct instance_data array) Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index ed75e9aa0..d69d501ac 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9368,7 +9368,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
maplist[sd->bl.m].users_pvp++;
}
if( maplist[sd->bl.m].instance_id >= 0 ) {
- instances[maplist[sd->bl.m].instance_id].users++;
+ instance->list[maplist[sd->bl.m].instance_id].users++;
instance->check_idle(maplist[sd->bl.m].instance_id);
}
sd->state.debug_remove_map = 0; // temporary state to track double remove_map's [FlavioJS]
@@ -16017,20 +16017,20 @@ int clif_instance(int instance_id, int type, int flag) {
unsigned char buf[255];
enum send_target target = PARTY;
- switch( instances[instance_id].owner_type ) {
+ switch( instance->list[instance_id].owner_type ) {
case IOT_NONE:
return 0;
case IOT_GUILD:
target = GUILD;
- sd = guild->getavailablesd(guild->search(instances[instance_id].owner_id));
+ sd = guild->getavailablesd(guild->search(instance->list[instance_id].owner_id));
break;
case IOT_PARTY:
/* default is already PARTY */
- sd = party->getavailablesd(party->search(instances[instance_id].owner_id));
+ sd = party->getavailablesd(party->search(instance->list[instance_id].owner_id));
break;
case IOT_CHAR:
target = SELF;
- sd = map->id2sd(instances[instance_id].owner_id);
+ sd = map->id2sd(instance->list[instance_id].owner_id);
break;
}
@@ -16043,7 +16043,7 @@ int clif_instance(int instance_id, int type, int flag) {
// Required to start the instancing information window on Client
// This window re-appear each "refresh" of client automatically until type 4 is send to client.
WBUFW(buf,0) = 0x02CB;
- memcpy(WBUFP(buf,2),instances[instance_id].name,INSTANCE_NAME_LENGTH);
+ memcpy(WBUFP(buf,2),instance->list[instance_id].name,INSTANCE_NAME_LENGTH);
WBUFW(buf,63) = flag;
clif->send(buf,packet_len(0x02CB),&sd->bl,target);
break;
@@ -16058,13 +16058,13 @@ int clif_instance(int instance_id, int type, int flag) {
case 4:
// S 0x2cd <Instance Name>.61B <Instance Remaining Time>.L <Instance Noplayers close time>.L
WBUFW(buf,0) = 0x02CD;
- memcpy(WBUFP(buf,2),instances[instance_id].name,61);
+ memcpy(WBUFP(buf,2),instance->list[instance_id].name,61);
if( type == 3 ) {
- WBUFL(buf,63) = instances[instance_id].progress_timeout;
+ WBUFL(buf,63) = instance->list[instance_id].progress_timeout;
WBUFL(buf,67) = 0;
} else {
WBUFL(buf,63) = 0;
- WBUFL(buf,67) = instances[instance_id].idle_timeout;
+ WBUFL(buf,67) = instance->list[instance_id].idle_timeout;
}
clif->send(buf,packet_len(0x02CD),&sd->bl,target);
break;
@@ -16086,24 +16086,24 @@ int clif_instance(int instance_id, int type, int flag) {
void clif_instance_join(int fd, int instance_id)
{
- if( instances[instance_id].idle_timer != INVALID_TIMER ) {
+ if( instance->list[instance_id].idle_timer != INVALID_TIMER ) {
WFIFOHEAD(fd,packet_len(0x02CD));
WFIFOW(fd,0) = 0x02CD;
- memcpy(WFIFOP(fd,2),instances[instance_id].name,61);
+ memcpy(WFIFOP(fd,2),instance->list[instance_id].name,61);
WFIFOL(fd,63) = 0;
- WFIFOL(fd,67) = instances[instance_id].idle_timeout;
+ WFIFOL(fd,67) = instance->list[instance_id].idle_timeout;
WFIFOSET(fd,packet_len(0x02CD));
- } else if( instances[instance_id].progress_timer != INVALID_TIMER ) {
+ } else if( instance->list[instance_id].progress_timer != INVALID_TIMER ) {
WFIFOHEAD(fd,packet_len(0x02CD));
WFIFOW(fd,0) = 0x02CD;
- memcpy(WFIFOP(fd,2),instances[instance_id].name,61);
- WFIFOL(fd,63) = instances[instance_id].progress_timeout;
+ memcpy(WFIFOP(fd,2),instance->list[instance_id].name,61);
+ WFIFOL(fd,63) = instance->list[instance_id].progress_timeout;
WFIFOL(fd,67) = 0;
WFIFOSET(fd,packet_len(0x02CD));
} else {
WFIFOHEAD(fd,packet_len(0x02CB));
WFIFOW(fd,0) = 0x02CB;
- memcpy(WFIFOP(fd,2),instances[instance_id].name,61);
+ memcpy(WFIFOP(fd,2),instance->list[instance_id].name,61);
WFIFOW(fd,63) = 0;
WFIFOSET(fd,packet_len(0x02CB));
}