summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c3
-rw-r--r--src/map/npc.c3
-rw-r--r--src/map/script.c19
3 files changed, 19 insertions, 6 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d6389639f..adaa5c117 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7711,8 +7711,7 @@ atcommand_autoloot(
drate = atof(message);
rate = (int)(drate*100);
}
- if (rate > 10000) rate = 10000;
- else if (rate < 0) rate = 0;
+ if (rate < 0) rate = 0;
sd->state.autoloot = rate;
if (sd->state.autoloot) {
diff --git a/src/map/npc.c b/src/map/npc.c
index 87d6a9b17..e0dda3344 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2484,6 +2484,9 @@ void npc_parsesrcfile (char *name)
}
line[j] = '\0'; //Forget to terminate the string. From [jA 1091]
// 最初はタブ区切りでチェックしてみて、ダメならスペース区切りで確認
+ w1[0] = w2[0] = w3[0] = w4[0] = '\0'; //It's best to initialize values
+ //to prevent passing previously parsed values to the parsers when not all
+ //fields are specified. [Skotlex]
if ((count = sscanf(line,"%[^\t]\t%[^\t]\t%[^\t\r\n]\t%n%[^\t\r\n]", w1, w2, w3, &w4pos, w4)) < 3 &&
(count = sscanf(line,"%s%s%s%n%s", w1, w2, w3, &w4pos, w4)) < 3) {
continue;
diff --git a/src/map/script.c b/src/map/script.c
index 3760e75cf..f5230dc3e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -504,7 +504,7 @@ struct {
{buildin_readparam,"readparam","i*"},
{buildin_getcharid,"getcharid","i*"},
{buildin_getpartyname,"getpartyname","i"},
- {buildin_getpartymember,"getpartymember","i"},
+ {buildin_getpartymember,"getpartymember","i*"},
{buildin_getguildname,"getguildname","i"},
{buildin_getguildmaster,"getguildmaster","i"},
{buildin_getguildmasterid,"getguildmasterid","i"},
@@ -4303,16 +4303,27 @@ int buildin_getpartyname(struct script_state *st)
int buildin_getpartymember(struct script_state *st)
{
struct party *p;
- int i,j=0;
+ int i,j=0,type=0;
p=NULL;
p=party_search(conv_num(st,& (st->stack->stack_data[st->start+2])));
+ if( st->end>st->start+3 )
+ type=conv_num(st,& (st->stack->stack_data[st->start+3]));
+
if(p!=NULL){
for(i=0;i<MAX_PARTY;i++){
if(p->member[i].account_id){
-// printf("name:%s %d\n",p->member[i].name,i);
- mapreg_setregstr(add_str((unsigned char *) "$@partymembername$")+(i<<24),p->member[i].name);
+ switch (type) {
+ case 2:
+ mapreg_setreg(add_str((unsigned char *) "$@partymemberaid")+(j<<24),p->member[i].account_id);
+ break;
+ case 1:
+ mapreg_setreg(add_str((unsigned char *) "$@partymembercid")+(j<<24),p->member[i].char_id);
+ break;
+ default:
+ mapreg_setregstr(add_str((unsigned char *) "$@partymembername$")+(j<<24),p->member[i].name);
+ }
j++;
}
}