View Single Post
  #1  
Old 09-04-2010, 04:36 PM
wheeljack
Fire Beetle
 
Join Date: Aug 2010
Posts: 18
Default COMMITTED Fix for missing tradeskill favorites

Problem: If you add the tradeskill favorite recipes A, B, C, then remove A, you can no longer see any of your favorites. If you add some other recipe D to your favorites, you can now see B, C, and D when you show your favorites. This is because when you remove a recipe it doesn't rearrange all the other favorites, it just makes the favorite slot unavailable.

Solution: Make the favorites requesting function loop over blank (aka 0 valued) entries in case there are "holes" in the request array.

Code:
Index: zone/client_packet.cpp
===================================================================
--- zone/client_packet.cpp	(revision 1639)
+++ zone/client_packet.cpp	(working copy)
@@ -5544,7 +5544,7 @@
 	//Assumes item IDs are <10 characters long
 	for(r = 0; r < 500; r++) { 
 		if(tsf->favorite_recipes[r] == 0)
-			break;	//assume the first 0 is the end...
+			continue; //what's sent in from the client can have holes in it, need to loop over them all
 
 		if(first) {
 			pos += snprintf(pos, 10, "%u", tsf->favorite_recipes[r]);
Reply With Quote