Explorar el Código

fixed named item storage dupe
in sql

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1013 54d463be-8e91-2dee-dedb-b68131a5f0ec

(no author) hace 20 años
padre
commit
f107fd6254
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 2 0
      Changelog.txt
  2. 3 2
      src/char_sql/char.c

+ 2 - 0
Changelog.txt

@@ -1,6 +1,8 @@
 Date	Added
 
 01/29
+	* Fixed Storage Bug with Named Stackable items. Thanks to Nimion [Lupus]
+		e.g. Arrows, Iron, Elemental stones, etc...
         * Added a crash check to Safety Wall, thanks to LebrEf[TaVu] / Freya for
           pointing it out [celest]
         * Added some optimisations in clif_parse_MapMove, by Ilpalazzo-sama [celest]

+ 3 - 2
src/char_sql/char.c

@@ -815,10 +815,11 @@ int memitemdata_to_sql(struct itemtemp mapitem, int eqcount, int noteqcount, int
 							//printf("the same item : %d ; i : %d ; flag :  %d\n", mapitem.notequip[i].nameid, i, mapitem.notequip[i].flag); //DEBUG-STRING
 						}
 						else{
+							//named item dupe bugfix by Nimion [Lupus]
 							sprintf(tmp_sql,"UPDATE `%s` SET `amount`='%d', `equip`='%d', `identify`='%d',"
-							"`attribute`='%d' WHERE `%s`='%d' AND `nameid`='%d'",
+							"`attribute`='%d' WHERE `%s`='%d' AND `nameid`='%d' AND `card0`='%d' AND `card2`='%d'",
 							tablename, mapitem.notequip[i].amount, mapitem.notequip[i].equip, mapitem.notequip[i].identify, mapitem.notequip[i].attribute,
-							selectoption, char_id, mapitem.notequip[i].nameid);
+							selectoption, char_id, mapitem.notequip[i].nameid,mapitem.notequip[i].card[0],mapitem.notequip[i].card[2]);
 							//printf("%s",tmp_sql);
 							if(mysql_query(&mysql_handle, tmp_sql))
 								printf("DB server Error (UPdate `notequ %s`)- %s\n",tablename ,mysql_error(&mysql_handle));