Prechádzať zdrojové kódy

- Likely fixed "half" of the alliance being saved, which ends up in guilds that can attack another, but not viceversa.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8761 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 rokov pred
rodič
commit
f7e2c8a84c
2 zmenil súbory, kde vykonal 8 pridanie a 2 odobranie
  1. 2 0
      Changelog-Trunk.txt
  2. 6 2
      src/char_sql/int_guild.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/09/14
+	* Likely fixed "half" of the alliance being saved, which ends up in guilds
+	  that can attack another, but not viceversa. [Skotlex]
 	* Added deleting of saved Status changes on character delete for the
 	  Char-TXT server. [Skotlex]
 	* Fixed the can-act delay never being checked when requesting to use

+ 6 - 2
src/char_sql/int_guild.c

@@ -294,8 +294,12 @@ int inter_guild_tosql(struct guild *g,int flag)
 
 	if (flag&GS_ALLIANCE)
 	{
-		// Delete current alliances
-		sprintf(tmp_sql, "DELETE FROM `%s` WHERE `guild_id`='%d' OR `alliance_id`='%d'",guild_alliance_db, g->guild_id,g->guild_id);
+		// Delete current alliances 
+		// NOTE: no need to do it on both sides since both guilds in memory had 
+		// their info changed, not to mention this would also mess up oppositions!
+		// [Skotlex]
+//		sprintf(tmp_sql, "DELETE FROM `%s` WHERE `guild_id`='%d' OR `alliance_id`='%d'",guild_alliance_db, g->guild_id,g->guild_id);
+		sprintf(tmp_sql, "DELETE FROM `%s` WHERE `guild_id`='%d'",guild_alliance_db, g->guild_id);
 		if(mysql_query(&mysql_handle, tmp_sql) )
 		{
 			ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));