summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-24 08:50:59 +0000
committerglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-24 08:50:59 +0000
commit913fd65ef9a5fa55ebbd5ac4502f72895879fc84 (patch)
tree0241f5c639284276a216f86a964c8ff64bb0532b /src/map/script.c
parenteef34512a2f465f7b2b5453fadfcc0e61c097e01 (diff)
downloadhercules-913fd65ef9a5fa55ebbd5ac4502f72895879fc84.tar.gz
hercules-913fd65ef9a5fa55ebbd5ac4502f72895879fc84.tar.bz2
hercules-913fd65ef9a5fa55ebbd5ac4502f72895879fc84.tar.xz
hercules-913fd65ef9a5fa55ebbd5ac4502f72895879fc84.zip
-Fix bugreport:6751 allow noseige to be casted while under status.
-Upd athena-start, save pid to not kill all other process with same name (annoying when multiple server) -Harmonize setmapflag and @mapflag, flag value is always an int, and could be superior to 1 for some mapflag -Fix bugreport:6923 for Windows -Upd @zeny to remove rest of zeny if not enough money as requested git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16959 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 0ae150f72..f1a422b7e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9648,7 +9648,7 @@ BUILDIN_FUNC(getusers)
BUILDIN_FUNC(getusersname)
{
TBL_PC *sd, *pl_sd;
- int disp_num=1, group_level = 0;
+ int /*disp_num=1,*/ group_level = 0;
struct s_mapiterator* iter;
sd = script_rid2sd(st);
@@ -10727,12 +10727,12 @@ BUILDIN_FUNC(setmapflag)
{
int m,i;
const char *str;
- const char *val=NULL;
+ int val=0;
str=script_getstr(st,2);
i=script_getnum(st,3);
if(script_hasdata(st,4)){
- val=script_getstr(st,4);
+ val=script_getnum(st,4);
}
m = map_mapname2mapid(str);
if(m >= 0) {
@@ -10784,13 +10784,13 @@ BUILDIN_FUNC(setmapflag)
case MF_NOWARPTO: map[m].flag.nowarpto = 1; break;
case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 1; break;
case MF_RESTRICTED:
- map[m].zone |= 1<<((int)atoi(val)+1);
+ map[m].zone |= 1<<(val+1);
map[m].flag.restricted=1;
break;
- case MF_NOCOMMAND: map[m].nocommand = (!val || atoi(val) <= 0) ? 100 : atoi(val); break;
+ case MF_NOCOMMAND: map[m].nocommand = (val <= 0) ? 100 : 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;
- case MF_BEXP: map[m].bexp = (!val || atoi(val) < 0) ? 100 : atoi(val); break;
+ case MF_JEXP: map[m].jexp = (val <= 0) ? 100 : val; break;
+ case MF_BEXP: map[m].bexp = (val <= 0) ? 100 : val; break;
case MF_NOVENDING: map[m].flag.novending = 1; break;
case MF_LOADEVENT: map[m].flag.loadevent = 1; break;
case MF_NOCHAT: map[m].flag.nochat = 1; break;
@@ -10801,7 +10801,7 @@ BUILDIN_FUNC(setmapflag)
case MF_ALLOWKS: map[m].flag.allowks = 1; break;
case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport = 1; break;
case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank = 1; break;
- case MF_BATTLEGROUND: map[m].flag.battleground = (!val || atoi(val) < 0 || atoi(val) > 2) ? 1 : atoi(val); break;
+ case MF_BATTLEGROUND: map[m].flag.battleground = (val <= 0 || val > 2) ? 1 : val; break;
case MF_RESET: map[m].flag.reset = 1; break;
}
}
@@ -10813,12 +10813,12 @@ BUILDIN_FUNC(removemapflag)
{
int m,i;
const char *str;
- const char *val=NULL;
+ int val=0;
str=script_getstr(st,2);
i=script_getnum(st,3);
if(script_hasdata(st,4)){
- val=script_getstr(st,4);
+ val=script_getnum(st,4);
}
m = map_mapname2mapid(str);
if(m >= 0) {
@@ -10868,7 +10868,7 @@ BUILDIN_FUNC(removemapflag)
case MF_NOWARPTO: map[m].flag.nowarpto = 0; break;
case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 0; break;
case MF_RESTRICTED:
- map[m].zone ^= 1<<((int)atoi(val)+1);
+ map[m].zone ^= 1<<(val+1);
if (map[m].zone == 0){
map[m].flag.restricted=0;
}
@@ -16942,7 +16942,7 @@ BUILDIN_FUNC(getcharip)
/* initiliaze */
const char *ip_addr = NULL;
uint32 ip;
-
+
/* set ip, ip_addr and convert to ip and push str */
ip = session[sd->fd]->client_addr;
ip_addr = ip2str(ip, NULL);