summaryrefslogtreecommitdiff
path: root/src/char/int_party.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-07 17:38:31 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-15 11:47:29 +0300
commit8338483dd4c41bc9831bebc9d6dc1808247fc497 (patch)
tree62af0b36fdd3552eda22e3197f1d3e0e7fb30fc1 /src/char/int_party.c
parent9658066ce2f411375b9876d0c02737752b816e58 (diff)
downloadhercules-8338483dd4c41bc9831bebc9d6dc1808247fc497.tar.gz
hercules-8338483dd4c41bc9831bebc9d6dc1808247fc497.tar.bz2
hercules-8338483dd4c41bc9831bebc9d6dc1808247fc497.tar.xz
hercules-8338483dd4c41bc9831bebc9d6dc1808247fc497.zip
Add most functions from char.c to interfaces.
Introduced interfaces: chr, mapif, loginif.
Diffstat (limited to 'src/char/int_party.c')
-rw-r--r--src/char/int_party.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index bc2fbd964..8253df675 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -12,6 +12,7 @@
#include "char.h"
#include "inter.h"
+#include "mapif.h"
#include "../common/cbasetypes.h"
#include "../common/db.h"
#include "../common/malloc.h"
@@ -81,7 +82,7 @@ static void inter_party_calc_state(struct party_data *p)
if(p->party.member[i].online)
p->party.count++;
}
- if( p->size == 2 && ( char_char_child(p->party.member[0].char_id,p->party.member[1].char_id) || char_char_child(p->party.member[1].char_id,p->party.member[0].char_id) ) ) {
+ if( p->size == 2 && ( chr->char_child(p->party.member[0].char_id,p->party.member[1].char_id) || chr->char_child(p->party.member[1].char_id,p->party.member[0].char_id) ) ) {
//Child should be able to share with either of their parents [RoM]
if(p->party.member[0].class_&0x2000) //first slot is the child?
p->family = p->party.member[0].char_id;
@@ -89,7 +90,7 @@ static void inter_party_calc_state(struct party_data *p)
p->family = p->party.member[1].char_id;
} else if( p->size == 3 ) {
//Check Family State.
- p->family = char_char_family(
+ p->family = chr->char_family(
p->party.member[0].char_id,
p->party.member[1].char_id,
p->party.member[2].char_id
@@ -374,9 +375,9 @@ static void mapif_party_info(int fd, struct party* p, int char_id)
memcpy(WBUFP(buf,8), p, sizeof(struct party));
if(fd<0)
- mapif_sendall(buf,WBUFW(buf,2));
+ mapif->sendall(buf,WBUFW(buf,2));
else
- mapif_send(fd,buf,WBUFW(buf,2));
+ mapif->send(fd,buf,WBUFW(buf,2));
}
//Whether or not additional party members
@@ -403,9 +404,9 @@ int mapif_party_optionchanged(int fd,struct party *p,int account_id,int flag)
WBUFW(buf,12)=p->item;
WBUFB(buf,14)=flag;
if(flag==0)
- mapif_sendall(buf,15);
+ mapif->sendall(buf,15);
else
- mapif_send(fd,buf,15);
+ mapif->send(fd,buf,15);
return 0;
}
@@ -417,7 +418,7 @@ int mapif_party_withdraw(int party_id,int account_id, int char_id) {
WBUFL(buf,2) = party_id;
WBUFL(buf,6) = account_id;
WBUFL(buf,10) = char_id;
- mapif_sendall(buf, 14);
+ mapif->sendall(buf, 14);
return 0;
}
@@ -433,7 +434,7 @@ int mapif_party_membermoved(struct party *p,int idx)
WBUFW(buf,14) = p->member[idx].map;
WBUFB(buf,16) = p->member[idx].online;
WBUFW(buf,17) = p->member[idx].lv;
- mapif_sendall(buf, 19);
+ mapif->sendall(buf, 19);
return 0;
}
@@ -444,7 +445,7 @@ int mapif_party_broken(int party_id,int flag)
WBUFW(buf,0)=0x3826;
WBUFL(buf,2)=party_id;
WBUFB(buf,6)=flag;
- mapif_sendall(buf,7);
+ mapif->sendall(buf,7);
//printf("int_party: broken %d\n",party_id);
return 0;
}
@@ -458,7 +459,7 @@ int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd)
WBUFL(buf,4)=party_id;
WBUFL(buf,8)=account_id;
memcpy(WBUFP(buf,12),mes,len);
- mapif_sendallwos(sfd, buf,len+12);
+ mapif->sendallwos(sfd, buf,len+12);
return 0;
}