diff options
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 7 |
1 files changed, 3 insertions, 4 deletions
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++);
|