Преглед на файлове

Corrected the order of items displayed in player inventory/storage (#8855)

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
Atemo преди 3 месеца
родител
ревизия
fda4c754c0
променени са 3 файла, в които са добавени 7 реда и са изтрити 3 реда
  1. 2 2
      conf/battle/client.conf
  2. 1 1
      src/char/char.cpp
  3. 4 0
      src/map/clif.cpp

+ 2 - 2
conf/battle/client.conf

@@ -113,8 +113,8 @@ display_status_timers: yes
 // packets for the desired number. (Note 1)
 client_reshuffle_dice: yes
 
-// Sorts the character and guild storage before it is sent to the client.
-// Official servers do not sort storage. (Note 1)
+// Sorts the cart, guild storage, inventory and storage before it is sent to the client. (Note 1)
+// Official servers do not sort them.
 // NOTE: Enabling this option degrades performance.
 client_sort_storage: no
 

+ 1 - 1
src/char/char.cpp

@@ -803,7 +803,7 @@ bool char_memitemdata_from_sql(struct s_storage* p, int32 max, int32 id, enum st
 		StringBuf_Printf(&buf, ", `option_val%d`", j);
 		StringBuf_Printf(&buf, ", `option_parm%d`", j);
 	}
-	StringBuf_Printf(&buf, " FROM `%s` WHERE `%s`=? ORDER BY `nameid`", tablename, selectoption );
+	StringBuf_Printf(&buf, " FROM `%s` WHERE `%s`=? ORDER BY `id`", tablename, selectoption );
 
 	if( SQL_ERROR == stmt.PrepareStr(StringBuf_Value(&buf))
 		||	SQL_ERROR == stmt.BindParam(0, SQLDT_INT32, &id, 0)

+ 4 - 0
src/map/clif.cpp

@@ -3066,6 +3066,8 @@ void clif_inventorylist( map_session_data *sd ){
 	int32 equip = 0;
 	int32 normal = 0;
 
+	storage_sortitem( sd->storage.u.items_inventory, ARRAYLENGTH( sd->storage.u.items_inventory ) );
+
 	for( int32 i = 0; i < MAX_INVENTORY; i++ ){
 		if( sd->inventory.u.items_inventory[i].nameid == 0 || sd->inventory_data[i] == nullptr ){
 			continue;
@@ -3245,6 +3247,8 @@ void clif_cartlist( map_session_data *sd ){
 	int32 normal = 0;
 	int32 equip = 0;
 
+	storage_sortitem( sd->storage.u.items_cart, ARRAYLENGTH( sd->storage.u.items_cart ) );
+
 	for( int32 i = 0; i < MAX_CART; i++ ){
 		if( sd->cart.u.items_cart[i].nameid == 0 ){
 			continue;