EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   COMMITTED Fix for missing tradeskill favorites (https://www.eqemulator.org/forums/showthread.php?t=32027)

wheeljack 09-04-2010 04:36 PM

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]);


Derision 09-11-2010 04:23 AM

Committed. Thanks :)


All times are GMT -4. The time now is 08:18 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.