From 34e32336184d870eb3682fb9ef539f5d69bcb65f Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 1 Aug 2006 04:24:45 +0000 Subject: - Fixed the subnet 0 mask being reset to 0 when someone goes up on the fame rankings. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8021 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/char/char.c | 7 +++---- src/char_sql/char.c | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 329671a02..fc2d325a3 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/07/31 + * Fixed the subnet 0 mask being reset to 0 when someone goes up on the fame + rankings. [Skotlex] * Updated Poison React chance to counter and number of counters as per skill description updates. [Skotlex] * Fixed Sharpshooting being counted as a magic attack, and hence, using diff --git a/src/char/char.c b/src/char/char.c index e6becbd5d..7f7421d42 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3023,8 +3023,7 @@ int parse_frommap(int fd) { if (RFIFOREST(fd) < 12) return 0; { - int j; - int id = RFIFOL(fd, 2); + int cid = RFIFOL(fd, 2); int fame = RFIFOL(fd, 6); char type = RFIFOB(fd, 10); char pos = RFIFOB(fd, 11); @@ -3064,14 +3063,14 @@ int parse_frommap(int fd) { } // If the player's already in the list, remove the entry and shift the following ones 1 step up memmove(list+pos, list+pos+1, (size-pos-1) * sizeof(struct fame_list)); - list[size].fame = 0; // At worst, the guy'll end up last (shouldn't happen if fame only goes up) + list[size-1].fame = 0; // At worst, the guy'll end up last (shouldn't happen if fame only goes up) } // Find the position where the player has to be inserted for(i = 0; i < size && fame < list[i].fame; i++); // When found someone with less or as much fame, insert just above if(i >= size) break;//Out of ranking. memmove(list+i+1, list+i, (size-i-1) * sizeof(struct fame_list)); - list[i].id = id; + list[i].id = cid; list[i].fame = fame; // Look for the player's name for(j = 0; j < char_num && char_dat[j].status.char_id != id; j++); diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 1a0945695..4ab63f14c 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -2881,7 +2881,7 @@ int parse_frommap(int fd) { if (RFIFOREST(fd) < 12) return 0; { - int id = RFIFOL(fd, 2); + int cid = RFIFOL(fd, 2); int fame = RFIFOL(fd, 6); char type = RFIFOB(fd, 10); char pos = RFIFOB(fd, 11); @@ -2917,7 +2917,7 @@ int parse_frommap(int fd) { } // If the player's already in the list, remove the entry and shift the following ones 1 step up memmove(list+pos, list+pos+1, (size-pos-1) * sizeof(struct fame_list)); - list[size].fame = 0; // At worst, the guy'll end up last (shouldn't happen if fame only goes up) + list[size-1].fame = 0; // At worst, the guy'll end up last (shouldn't happen if fame only goes up) } // Find the position where the player has to be inserted @@ -2925,7 +2925,7 @@ int parse_frommap(int fd) { if(i>=size) break; //Out of ranking. // When found someone with less or as much fame, insert just above memmove(list+i+1, list+i, (size-i-1) * sizeof(struct fame_list)); - list[i].id = id; + list[i].id = cid; list[i].fame = fame; // Look for the player's name char_loadName(list[i].id, list[i].name); -- cgit v1.2.3-70-g09d2