summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:12:18 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:12:18 +0200
commit196c182f11aa46056a70507fcd93c97db9be911e (patch)
tree4e71d6cb73b287c8c6196aabbbccd3037bf032ec
parentfa14df7e5ba9f18c74f149fb3bcaee32dfd87f80 (diff)
downloadhercules-196c182f11aa46056a70507fcd93c97db9be911e.tar.gz
hercules-196c182f11aa46056a70507fcd93c97db9be911e.tar.bz2
hercules-196c182f11aa46056a70507fcd93c97db9be911e.tar.xz
hercules-196c182f11aa46056a70507fcd93c97db9be911e.zip
Apply code style to clif_party_option()
-rw-r--r--src/map/clif.c70
1 files changed, 42 insertions, 28 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index a75fc0dc3..f7f22f7b0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7292,25 +7292,48 @@ static void clif_party_inviteack(struct map_session_data *sd, const char *nick,
#endif
}
-/// Updates party settings.
-/// 0101 <exp option>.L (ZC_GROUPINFO_CHANGE)
-/// 07d8 <exp option>.L <item pick rule>.B <item share rule>.B (ZC_REQ_GROUPINFO_CHANGE_V2)
-/// exp option:
-/// 0 = exp sharing disabled
-/// 1 = exp sharing enabled
-/// 2 = cannot change exp sharing
-///
-/// flag:
-/// 0x01 = Cannot change EXP sharing. (Only set when tried to change options manually.)
-/// 0x02 = Options changed manually.
-/// 0x04 = Options changed automatically.
-/// 0x08 = Member added.
-/// 0x10 = Member removed.
-/// 0x20 = Character logged in.
-/// 0x40 = Character changed map.
-/// 0x80 = Character teleported.
+/**
+ * Sends party settings to the client.
+ *
+ * 0101 <exp option>.L (ZC_GROUPINFO_CHANGE)
+ * 07d8 <exp option>.L <item pick rule>.B <item share rule>.B (ZC_REQ_GROUPINFO_CHANGE_V2)
+ * <exp option>:
+ * 0 = EXP sharing disabled.
+ * 1 = EXP sharing enabled.
+ * 2 = Cannot change EXP sharing.
+ *
+ * @param p The related party.
+ * @param sd The related character.
+ * @param flag Reason for sending.
+ * @parblock
+ * Possible flags:
+ * 0x01 = Cannot change EXP sharing. (Only set when tried to change options manually.)
+ * 0x02 = Options changed manually.
+ * 0x04 = Options changed automatically.
+ * 0x08 = Member added.
+ * 0x10 = Member removed.
+ * 0x20 = Character logged in.
+ * 0x40 = Character changed map.
+ * 0x80 = Character teleported.
+ * @endparblock
+ *
+ **/
static void clif_party_option(struct party_data *p, struct map_session_data *sd, int flag)
{
+ nullpo_retv(p);
+
+ if (sd == NULL && (flag & 0x01) == 0) {
+ for (int i = 0; i < MAX_PARTY; i++) {
+ if (p->data[i].sd != NULL) {
+ sd = p->data[i].sd;
+ break;
+ }
+ }
+ }
+
+ if (sd == NULL)
+ return;
+
int conf = battle_config.send_party_options;
if (((flag & 0x01) != 0 && (conf & 0x10) == 0)
@@ -7345,23 +7368,14 @@ static void clif_party_option(struct party_data *p, struct map_session_data *sd,
cmd = 0x7d8;
}
- unsigned char buf[16];
#if PACKETVER < 20090603
if (cmd == 0x7d8)
cmd = 0x101;
#endif
- nullpo_retv(p);
+ unsigned char buf[16];
- if (sd == NULL && (flag & 0x01) == 0) {
- int i;
- for(i=0;i<MAX_PARTY && !p->data[i].sd;i++)
- ;
- if (i < MAX_PARTY)
- sd = p->data[i].sd;
- }
- if(!sd) return;
- WBUFW(buf,0)=cmd;
+ WBUFW(buf, 0) = cmd;
WBUFL(buf, 2) = ((flag & 0x10) != 0) ? 0 : (((flag & 0x01) != 0) ? 2 : p->party.exp);
if (cmd == 0x7d8) {