Browse Source

Party/guild names can no longer be less then 2 characters long.(bugreport:1328)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12521 54d463be-8e91-2dee-dedb-b68131a5f0ec
Kevin 17 years ago
parent
commit
b316eef727
3 changed files with 9 additions and 3 deletions
  1. 2 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/guild.c
  3. 6 2
      src/map/party.c

+ 2 - 0
Changelog-Trunk.txt

@@ -3,6 +3,8 @@ 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/04/07
+	* Party/guild names can no longer be less then 2 characters long. (r12521) [Kevin]
 2008/04/06
 	* Fixed a case where a dangling pointer was formed when a person was
 	- invited to a party immediately after creating their own. (r12518) [Kevin]

+ 1 - 1
src/map/guild.c

@@ -402,7 +402,7 @@ int guild_create(struct map_session_data *sd,char *name)
 {
 	nullpo_retr(0, sd);
 
-	if(sd->status.guild_id)
+	if(sd->status.guild_id || strlen(name) < 2)
 	{
 		clif_guild_created(sd,1);	// ‚·‚Å‚É�Š‘®‚µ‚Ä‚¢‚é
 		return 0;

+ 6 - 2
src/map/party.c

@@ -114,6 +114,12 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2)
 		return 0; // "already in a party"
 	}
 
+	if(strlen(name) < 2)
+	{
+		clif_party_created(sd, 1);
+		return 0;
+	}
+
 	//Temporarily set to -1 so cannot be spam invited
 	sd->status.party_id = -1;
 
@@ -132,8 +138,6 @@ void party_created(int account_id,int char_id,int fail,int party_id,char *name)
 
 	if (!sd || sd->status.char_id != char_id)
 	{	//Character logged off before creation ack?
-		if(sd)
-			sd->status.party_id = 0;
 		if (!fail) //break up party since player could not be added to it.
 			intif_party_leave(party_id,account_id,char_id);
 		return;