Ver código fonte

Added missing check to only allow the leader of a party to modify its exp share settings (bugreport:12)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12337 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 17 anos atrás
pai
commit
17dc136694
2 arquivos alterados com 16 adições e 3 exclusões
  1. 3 0
      Changelog-Trunk.txt
  2. 13 3
      src/map/clif.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2008/03/10
+	* Added missing check to only allow the leader of a party to modify
+	  its exp share settings (bugreport:12) [ultramage]
 2008/03/09
 	* Modified attack_walk_delay so it behaves on a 'per-object' basis, and
 	  changed the default to 15 (all types).

+ 13 - 3
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);
 }