summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-11 04:01:42 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-11 04:01:42 +0000
commit190eab1994cf4dcc04bba32a53057cab28910a9e (patch)
tree7209681878cbd273ebb85de42cc1f1969b50183f
parent8f4b6a735e96dcf5ae00b2eb755914c30be68a68 (diff)
downloadhercules-190eab1994cf4dcc04bba32a53057cab28910a9e.tar.gz
hercules-190eab1994cf4dcc04bba32a53057cab28910a9e.tar.bz2
hercules-190eab1994cf4dcc04bba32a53057cab28910a9e.tar.xz
hercules-190eab1994cf4dcc04bba32a53057cab28910a9e.zip
Applied Ai4rei's patch to prevent an invalid rid from being attached to the execution of a script. (bugreport:4470)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14424 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/script.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index e557cf89f..db96e5604 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2010/10/10
+ * Applied Ai4rei's patch to prevent an invalid rid from being attached to the execution of a script. (bugreport:4470) [Paradox924X]
* Added NULL initialization to info variable in map_readfromcache() to satiate compiler. (bugreport:4399) [Paradox924X]
* Applied Ai4rei's patch to eliminate unnecessary and redundant castle data saving. (bugreport:4471) [Paradox924X]
* Added a missing const qualifier to a variable. (bugreport:4472) [Paradox924X]
diff --git a/src/map/script.c b/src/map/script.c
index 4304aeea7..b37c31c1e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9068,8 +9068,13 @@ BUILDIN_FUNC(warpwaitingpc)
*------------------------------------------*/
BUILDIN_FUNC(attachrid)
{
- st->rid=script_getnum(st,2);
- script_pushint(st,(map_id2sd(st->rid)!=NULL));
+ int rid = script_getnum(st,2);
+
+ if (map_id2sd(rid)) {
+ st->rid = rid;
+ script_pushint(st,1);
+ } else
+ script_pushint(st,0);
return 0;
}
/*==========================================