summaryrefslogtreecommitdiff
path: root/src/char/int_quest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/int_quest.c')
-rw-r--r--src/char/int_quest.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index dd3d4e1bf..cf9b9c172 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -6,21 +6,20 @@
#include "int_quest.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#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"
-#include "../common/timer.h"
struct inter_quest_interface inter_quest_s;
@@ -66,8 +65,9 @@ struct quest *mapif_quests_fromsql(int char_id, int *count)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &tmp_quest.quest_id, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &tmp_quest.state, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_UINT, &tmp_quest.time, 0, NULL, NULL)
- )
+ ) {
sqlerror = SQL_ERROR;
+ }
StrBuf->Destroy(&buf);
@@ -249,8 +249,10 @@ void mapif_send_quests(int fd, int char_id, struct quest *tmp_questlog, int num_
WFIFOW(fd,2) = num_quests*sizeof(struct quest)+8;
WFIFOL(fd,4) = char_id;
- if (num_quests > 0)
+ if (num_quests > 0) {
+ nullpo_retv(tmp_questlog);
memcpy(WFIFOP(fd,8), tmp_questlog, sizeof(struct quest)*num_quests);
+ }
WFIFOSET(fd,num_quests*sizeof(struct quest)+8);
}