diff options
author | xazax-hun <xazax-hun@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-25 18:49:58 +0000 |
---|---|---|
committer | xazax-hun <xazax-hun@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-25 18:49:58 +0000 |
commit | 10921d4dbfbe634087c9711971455b7d9281ed31 (patch) | |
tree | d1474bb6742a9956987dbbe0aa9c46668d8cae4e /src | |
parent | cb5a1ec7d39927184ce79e05f9c453603cb47883 (diff) | |
download | hercules-10921d4dbfbe634087c9711971455b7d9281ed31.tar.gz hercules-10921d4dbfbe634087c9711971455b7d9281ed31.tar.bz2 hercules-10921d4dbfbe634087c9711971455b7d9281ed31.tar.xz hercules-10921d4dbfbe634087c9711971455b7d9281ed31.zip |
Fixed setting and removing restricted mapflags. bugreport:4119
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15273 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c index 4ce9e380e..1fdbc7c01 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9787,7 +9787,10 @@ BUILDIN_FUNC(setmapflag) case MF_NORETURN: map[m].flag.noreturn = 1; break; case MF_NOWARPTO: map[m].flag.nowarpto = 1; break; case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 1; break; - case MF_RESTRICTED: map[m].flag.restricted = 1; break; + case MF_RESTRICTED: + map[m].zone |= 1<<((int)atoi(val)+1); + map[m].flag.restricted=1; + break; case MF_NOCOMMAND: map[m].nocommand = (!val || atoi(val) <= 0) ? 100 : atoi(val); break; case MF_NODROP: map[m].flag.nodrop = 1; break; case MF_JEXP: map[m].jexp = (!val || atoi(val) < 0) ? 100 : atoi(val); break; @@ -9814,9 +9817,13 @@ BUILDIN_FUNC(removemapflag) { int m,i; const char *str; + const char *val=NULL; str=script_getstr(st,2); i=script_getnum(st,3); + if(script_hasdata(st,4)){ + val=script_getstr(st,4); + } m = map_mapname2mapid(str); if(m >= 0) { switch(i) { @@ -9858,7 +9865,12 @@ BUILDIN_FUNC(removemapflag) case MF_NORETURN: map[m].flag.noreturn = 0; break; case MF_NOWARPTO: map[m].flag.nowarpto = 0; break; case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 0; break; - case MF_RESTRICTED: map[m].flag.restricted = 0; break; + case MF_RESTRICTED: + map[m].zone ^= 1<<((int)atoi(val)+1); + if (map[m].zone == 0){ + map[m].flag.restricted=0; + } + break; case MF_NOCOMMAND: map[m].nocommand = 0; break; case MF_NODROP: map[m].flag.nodrop = 0; break; case MF_JEXP: map[m].jexp = 0; break; @@ -16134,7 +16146,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(setmapflagnosave,"ssii"), BUILDIN_DEF(getmapflag,"si"), BUILDIN_DEF(setmapflag,"si?"), - BUILDIN_DEF(removemapflag,"si"), + BUILDIN_DEF(removemapflag,"si?"), BUILDIN_DEF(pvpon,"s"), BUILDIN_DEF(pvpoff,"s"), BUILDIN_DEF(gvgon,"s"), |