summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-10 20:06:39 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-10 20:06:39 +0000
commit5a267de7af95452c9babb3b48f1adc7391c9f133 (patch)
tree76268957d8130f592a86cdf1a18467cb4548ccae /src/map/clif.c
parent8211b9abc7dfcd2d6298063a363c8cd5000f6fe6 (diff)
downloadhercules-5a267de7af95452c9babb3b48f1adc7391c9f133.tar.gz
hercules-5a267de7af95452c9babb3b48f1adc7391c9f133.tar.bz2
hercules-5a267de7af95452c9babb3b48f1adc7391c9f133.tar.xz
hercules-5a267de7af95452c9babb3b48f1adc7391c9f133.zip
Added missing check to only allow the leader of a party to modify its exp share settings (bugreport:12)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12337 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 753916478..1b6b143bc 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9880,15 +9880,25 @@ void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd)
void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd)
{
struct party_data *p;
+ int i;
- if(!sd->status.party_id)
+ if( !sd->status.party_id )
return;
p = party_search(sd->status.party_id);
- if (!p) return;
+ if( p == NULL )
+ return;
+
+ ARR_FIND( 0, MAX_PARTY, i, p->data[i].sd == sd );
+ if( i == MAX_PARTY )
+ return; //Shouldn't happen
+
+ if( !p->party.member[i].leader )
+ return;
+
//The client no longer can change the item-field, therefore it always
//comes as zero. Here, resend the item data as it is.
-// party_changeoption(sd, RFIFOW(fd,2), RFIFOW(fd,4));
+// party_changeoption(sd, RFIFOW(fd,2), RFIFOW(fd,4));
party_changeoption(sd, RFIFOW(fd,2), p->party.item);
}