summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-17 23:41:02 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-17 23:41:02 +0000
commit1711d9e803b126c7863eef26691318592faafbf0 (patch)
treeab7d9656cfc848d88143bd985e947b3bb3b2c78c
parent934f4af797ab3f35c249cc70a1631696328f16d0 (diff)
downloadhercules-1711d9e803b126c7863eef26691318592faafbf0.tar.gz
hercules-1711d9e803b126c7863eef26691318592faafbf0.tar.bz2
hercules-1711d9e803b126c7863eef26691318592faafbf0.tar.xz
hercules-1711d9e803b126c7863eef26691318592faafbf0.zip
* Fixed a crash, when script command 'doevent' is called without an attached player (bugreport:3973).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14601 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/script.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 1e9c1cc52..f69b31f35 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,6 +1,7 @@
Date Added
2010/12/17
+ * Fixed a crash, when script command 'doevent' is called without an attached player (bugreport:3973). [Ai4rei]
* Fixed label definitions silently overwriting built-in script functions (bugreport:2806, follow up to r8027). [Ai4rei]
* Added temporary check to skill_delunitgroup to prevent crashes when 'group' is NULL and added some debug messages to track down the source of the crash (bugreport:3504). [Ai4rei]
* Spellchecked script_commands.txt. [Ai4rei]
diff --git a/src/map/script.c b/src/map/script.c
index 04cb0593b..3da635bf5 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7848,8 +7848,15 @@ BUILDIN_FUNC(clone)
BUILDIN_FUNC(doevent)
{
const char* event = script_getstr(st,2);
+ struct map_session_data* sd;
+
+ if( ( sd = script_rid2sd(st) ) == NULL )
+ {
+ return 0;
+ }
+
check_event(st, event);
- npc_event(map_id2sd(st->rid),event,0);
+ npc_event(sd, event, 0);
return 0;
}
/*==========================================