summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c70
3 files changed, 58 insertions, 14 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index ed5aa4cb9..e8d8e581f 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7345,6 +7345,7 @@ static const struct battle_data {
{ "searchstore_querydelay", &battle_config.searchstore_querydelay, 10, 0, INT_MAX, },
{ "searchstore_maxresults", &battle_config.searchstore_maxresults, 30, 1, INT_MAX, },
{ "display_party_name", &battle_config.display_party_name, 0, 0, 1, },
+ { "send_party_options", &battle_config.send_party_options, 0x31F9, 0, 0x1FFFF, },
{ "cashshop_show_points", &battle_config.cashshop_show_points, 0, 0, 1, },
{ "mail_show_status", &battle_config.mail_show_status, 0, 0, 2, },
{ "client_limit_unit_lv", &battle_config.client_limit_unit_lv, 0, 0, BL_ALL, },
diff --git a/src/map/battle.h b/src/map/battle.h
index 5a039a8ed..ceb94321e 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -471,6 +471,7 @@ struct Battle_Config {
int searchstore_querydelay;
int searchstore_maxresults;
int display_party_name;
+ int send_party_options;
int cashshop_show_points;
int mail_show_status;
int client_limit_unit_lv;
diff --git a/src/map/clif.c b/src/map/clif.c
index 8634925f0..a75fc0dc3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7307,13 +7307,48 @@ static void clif_party_inviteack(struct map_session_data *sd, const char *nick,
/// 0x08 = Member added.
/// 0x10 = Member removed.
/// 0x20 = Character logged in.
+/// 0x40 = Character changed map.
+/// 0x80 = Character teleported.
static void clif_party_option(struct party_data *p, struct map_session_data *sd, int flag)
{
+ int conf = battle_config.send_party_options;
+
+ if (((flag & 0x01) != 0 && (conf & 0x10) == 0)
+ || ((flag & 0x02) != 0 && (conf & 0x08) == 0)
+ || ((flag & 0x04) != 0 && (conf & 0x20) == 0)
+ || ((flag & 0x08) != 0 && (conf & 0x40) == 0)
+ || ((flag & 0x10) != 0 && (conf & 0x80) == 0)
+ || ((flag & 0x20) != 0 && (conf & 0x01) == 0)
+ || ((flag & 0x40) != 0 && (conf & 0x02) == 0)
+ || ((flag & 0x80) != 0 && (conf & 0x04) == 0)) {
+ return;
+ }
+
+ enum send_target target = SELF;
+
+ if (((flag & 0x01) != 0 && (conf & 0x100) != 0)
+ || ((flag & 0x01) == 0 && (flag & 0x02) != 0)
+ || (flag & 0x04) != 0) {
+ target = PARTY;
+ }
+
+ int cmd = 0x101;
+
+ if (((flag & 0x01) != 0 && (conf & 0x02000) != 0)
+ || ((flag & 0x02) != 0 && (conf & 0x01000) != 0)
+ || ((flag & 0x04) != 0 && (conf & 0x04000) != 0)
+ || ((flag & 0x08) != 0 && (conf & 0x08000) != 0)
+ || ((flag & 0x10) != 0 && (conf & 0x10000) != 0)
+ || ((flag & 0x20) != 0 && (conf & 0x00200) != 0)
+ || ((flag & 0x40) != 0 && (conf & 0x00400) != 0)
+ || ((flag & 0x80) != 0 && (conf & 0x00800) != 0)) {
+ cmd = 0x7d8;
+ }
+
unsigned char buf[16];
#if PACKETVER < 20090603
- const int cmd = 0x101;
-#else
- const int cmd = 0x7d8;
+ if (cmd == 0x7d8)
+ cmd = 0x101;
#endif
nullpo_retv(p);
@@ -7328,14 +7363,13 @@ static void clif_party_option(struct party_data *p, struct map_session_data *sd,
if(!sd) return;
WBUFW(buf,0)=cmd;
WBUFL(buf, 2) = ((flag & 0x10) != 0) ? 0 : (((flag & 0x01) != 0) ? 2 : p->party.exp);
-#if PACKETVER >= 20090603
- WBUFB(buf, 6) = ((flag & 0x10) != 0) ? 0 : (((p->party.item & 1) != 0) ? 1 : 0);
- WBUFB(buf, 7) = ((flag & 0x10) != 0) ? 0 : (((p->party.item & 2) != 0) ? 1 : 0);
-#endif
- if ((flag & 0x01) == 0 && ((flag & 0x04) != 0 || (flag & 0x02) != 0))
- clif->send(buf,packet_len(cmd),&sd->bl,PARTY);
- else
- clif->send(buf,packet_len(cmd),&sd->bl,SELF);
+
+ if (cmd == 0x7d8) {
+ WBUFB(buf, 6) = ((flag & 0x10) != 0) ? 0 : (((p->party.item & 1) != 0) ? 1 : 0);
+ WBUFB(buf, 7) = ((flag & 0x10) != 0) ? 0 : (((p->party.item & 2) != 0) ? 1 : 0);
+ }
+
+ clif->send(buf, packet_len(cmd), &sd->bl, target);
if ((flag & 0x04) != 0)
p->state.option_auto_changed = 0;
@@ -11036,11 +11070,19 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd)
#endif
}
- if (p != NULL && first_time) {
+ if (p != NULL) {
+ int flag;
+
if (p->state.option_auto_changed != 0)
- clif->party_option(p, sd, 0x04);
+ flag = 0x04;
+ else if (first_time)
+ flag = 0x20;
+ else if (change_map)
+ flag = 0x40;
else
- clif->party_option(p, sd, 0x20);
+ flag = 0x80;
+
+ clif->party_option(p, sd, flag);
}
if (((battle_config.display_rate_messages & 0x1) != 0 && first_time)