summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 89812b40b..1045f1c94 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -15682,7 +15682,8 @@ Questlog script commands
BUILDIN_FUNC(setquest)
{
- TBL_PC * sd = script_rid2sd(st);
+ struct map_session_data *sd = script_rid2sd(st);
+ nullpo_ret(sd);
quest_add(sd, script_getnum(st, 2));
return 0;
@@ -15690,7 +15691,8 @@ BUILDIN_FUNC(setquest)
BUILDIN_FUNC(erasequest)
{
- TBL_PC * sd = script_rid2sd(st);
+ struct map_session_data *sd = script_rid2sd(st);
+ nullpo_ret(sd);
quest_delete(sd, script_getnum(st, 2));
return 0;
@@ -15698,7 +15700,8 @@ BUILDIN_FUNC(erasequest)
BUILDIN_FUNC(completequest)
{
- TBL_PC * sd = script_rid2sd(st);
+ struct map_session_data *sd = script_rid2sd(st);
+ nullpo_ret(sd);
quest_update_status(sd, script_getnum(st, 2), Q_COMPLETE);
return 0;
@@ -15706,7 +15709,8 @@ BUILDIN_FUNC(completequest)
BUILDIN_FUNC(changequest)
{
- TBL_PC * sd = script_rid2sd(st);
+ struct map_session_data *sd = script_rid2sd(st);
+ nullpo_ret(sd);
quest_change(sd, script_getnum(st, 2),script_getnum(st, 3));
return 0;
@@ -15714,9 +15718,11 @@ BUILDIN_FUNC(changequest)
BUILDIN_FUNC(checkquest)
{
- TBL_PC * sd = script_rid2sd(st);
+ struct map_session_data *sd = script_rid2sd(st);
quest_check_type type = HAVEQUEST;
+ nullpo_ret(sd);
+
if( script_hasdata(st, 3) )
type = (quest_check_type)script_getnum(st, 3);