viewing paste Unknown #7336 | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -5367,6 +5367,8 @@
    nullpo_retv(sd);
    fd = sd->fd;
 
+   if(sd->menuskill_id == skill_id)
+       return; //Avoid resending the menu twice or more times...
    WFIFOHEAD(fd, 6 + 2 * MAX_SKILL_PRODUCE_DB);
    WFIFOW(fd,0) = 0x25a;
    WFIFOW(fd,4) = list_type; // list type
@@ -5384,23 +5386,14 @@
        c++;
    }
 
-   if( skill_id == AM_PHARMACY ) { // Only send it while Cooking else check for c.
-       WFIFOW(fd,2) = 6 + 2 * c;
-       WFIFOSET(fd,WFIFOW(fd,2));
-   }
-
-   if( c > 0 ) {
+   if( c > 0 || skill_id == AM_PHARMACY) {
        sd->menuskill_id = skill_id;
        sd->menuskill_val = trigger;
-       if( skill_id != AM_PHARMACY ) {
            sd->menuskill_val2 = qty; // amount.
            WFIFOW(fd,2) = 6 + 2 * c;
            WFIFOSET(fd,WFIFOW(fd,2));
-       }
    } else {
        clif_menuskill_clear(sd);
-       if( skill_id != AM_PHARMACY ) { // AM_PHARMACY is used to Cooking.
-           // It fails.
 #if PACKETVER >= 20090922
            clif_msg_skill(sd,skill_id,0x625);
 #else
@@ -5409,7 +5402,6 @@
 #endif
        }
    }
-}
 
 
 /// Notifies clients of a status change.
Viewed 1225 times, submitted by lighta.