diff options
author | gumi <git@gumi.ca> | 2018-01-29 14:32:59 -0500 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-01-29 14:34:08 -0500 |
commit | 4f696a07b35826314ca1f77fe83eca70cb0be356 (patch) | |
tree | 82e8939a4c465b6d5ff32c9f372abc416825fc15 /src/map/script-call.cpp | |
parent | eabef24da3aa0c1b206c508f0288a60e941cdc64 (diff) | |
download | tmwa-18.1.29.tar.gz tmwa-18.1.29.tar.bz2 tmwa-18.1.29.tar.xz tmwa-18.1.29.zip |
cowardly abort script if sd is missingv18.1.29
Diffstat (limited to 'src/map/script-call.cpp')
-rw-r--r-- | src/map/script-call.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/script-call.cpp b/src/map/script-call.cpp index 5714b41..289cb68 100644 --- a/src/map/script-call.cpp +++ b/src/map/script-call.cpp @@ -70,6 +70,8 @@ dumb_ptr<map_session_data> script_rid2sd(ScriptState *st) if (!sd) { PRINTF("script_rid2sd: fatal error ! player not attached!\n"_fmt); + st->state = ScriptEndState::END; + return nullptr; } return sd; } @@ -871,7 +873,8 @@ void run_script_main(ScriptState *st, Borrowed<const ScriptBuffer> rootscript) if (st->rid) { dumb_ptr<map_session_data> sd = script_rid2sd(st); - PRINTF("PC => %s\n"_fmt, sd->status_key.name.to__actual()); + if (sd) + PRINTF("PC => %s\n"_fmt, sd->status_key.name.to__actual()); } } abort(); |