Skip to content

Commit

Permalink
Fixed achievement handling in OnPCStatCalcEvent
Browse files Browse the repository at this point in the history
Fixes #2314

Thanks to @CairoLee
  • Loading branch information
Lemongrass3110 committed Aug 6, 2017
1 parent ee12429 commit 70c14fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/char/int_achievement.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions src/map/intif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

1 comment on commit 70c14fa

@CairoLee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repair confirmed, it's work fine! Thank you sir.

Please sign in to comment.