Explorar el Código

Fixed achievement handling in OnPCStatCalcEvent

Fixes #2314

Thanks to @CairoLee
Lemongrass3110 hace 7 años
padre
commit
70c14fa567
Se han modificado 2 ficheros con 6 adiciones y 0 borrados
  1. 4 0
      src/char/int_achievement.c
  2. 2 0
      src/map/intif.c

+ 4 - 0
src/char/int_achievement.c

@@ -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;
 }
 

+ 2 - 0
src/map/intif.c

@@ -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);