summaryrefslogtreecommitdiff
path: root/src/map/script.c
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
commit3b8cf07792244242cbd9788d95ec5cddd6b43a33 (patch)
treebb3487ca50728d619e49ddd9134dee1cb82353b6 /src/map/script.c
parent110a035e58738f0b9156c672194908680187a9cd (diff)
downloadhercules-3b8cf07792244242cbd9788d95ec5cddd6b43a33.tar.gz
hercules-3b8cf07792244242cbd9788d95ec5cddd6b43a33.tar.bz2
hercules-3b8cf07792244242cbd9788d95ec5cddd6b43a33.tar.xz
hercules-3b8cf07792244242cbd9788d95ec5cddd6b43a33.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/branches/renewal@14424 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c9
1 files changed, 7 insertions, 2 deletions
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;
}
/*==========================================