From 190eab1994cf4dcc04bba32a53057cab28910a9e Mon Sep 17 00:00:00 2001 From: Paradox924X Date: Mon, 11 Oct 2010 04:01:42 +0000 Subject: 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 --- src/map/script.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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; } /*========================================== -- cgit v1.2.3-70-g09d2