Fixed achievement handling in OnPCStatCalcEvent

Fixes #2314

Thanks to @CairoLee
This commit is contained in:
Lemongrass3110 2017-08-06 13:10:34 +02:00
parent ee1242908b
commit 70c14fa567
2 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,7 @@
#include "../common/db.h"
#include "../common/malloc.h"
#include "../common/mmo.h"
#include "../common/showmsg.h"
#include "../common/socket.h"
#include "../common/sql.h"
#include "../common/strlib.h"
@ -78,6 +79,9 @@ struct achievement *mapif_achievements_fromsql(uint32 char_id, int *count)
SqlStmt_Free(stmt);
StringBuf_Clear(&buf);
ShowInfo("achievement load complete from DB - id: %d (total: %d)\n", char_id, *count);
return achievelog;
}

View File

@ -2112,6 +2112,8 @@ void intif_parse_achievements(int fd)
if (sd->achievement_data.achievements) {
aFree(sd->achievement_data.achievements);
sd->achievement_data.achievements = NULL;
sd->achievement_data.incompleteCount = 0;
sd->achievement_data.count = 0;
}
} else {
struct achievement *received = (struct achievement *)RFIFOP(fd, 8);