- Fixed script command warpparty looking for an attached player even when it is not needed.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5592 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-03-13 20:16:27 +00:00
parent 8cba6f1973
commit d842b9f68d
2 changed files with 25 additions and 29 deletions

View File

@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/13 2006/03/13
* Fixed script command warpparty looking for an attached player even when
it is not needed. [Skotlex]
* Shield Reflect is now passed through Devotion as well. [Skotlex] * Shield Reflect is now passed through Devotion as well. [Skotlex]
- Devoted characters lose the devotion effect when the Crusader is at less - Devoted characters lose the devotion effect when the Crusader is at less
than 25% Hp. [Skotlex] than 25% Hp. [Skotlex]

View File

@ -2930,31 +2930,25 @@ int buildin_warpparty(struct script_state *st)
{ {
int x,y; int x,y;
char *str; char *str;
int p; int p_id;
int i; int i;
unsigned short mapindex; unsigned short mapindex;
struct map_session_data *pl_sd, **pl_allsd; struct map_session_data *pl_sd;
struct map_session_data *sd; struct party *p=NULL;
int users;
str=conv_str(st,& (st->stack->stack_data[st->start+2])); str=conv_str(st,& (st->stack->stack_data[st->start+2]));
x=conv_num(st,& (st->stack->stack_data[st->start+3])); x=conv_num(st,& (st->stack->stack_data[st->start+3]));
y=conv_num(st,& (st->stack->stack_data[st->start+4])); y=conv_num(st,& (st->stack->stack_data[st->start+4]));
p=conv_num(st,& (st->stack->stack_data[st->start+5])); p_id=conv_num(st,& (st->stack->stack_data[st->start+5]));
sd=script_rid2sd(st); if(p_id < 1)
if(map[sd->bl.m].flag.noreturn || map[sd->bl.m].flag.nowarpto)
return 0; return 0;
p = party_search(p_id);
if(p < 1) if (!p)
return 0; return 0;
pl_allsd = map_getallusers(&users);
if(strcmp(str,"Random")==0) if(strcmp(str,"Random")==0)
{ {
for (i = 0; i < MAX_PARTY; i++)
for (i = 0; i < users; i++)
{ {
if ((pl_sd = pl_allsd[i]) && pl_sd->status.party_id == p) if ((pl_sd = p->member[i].sd))
{ {
if(map[pl_sd->bl.m].flag.nowarp) if(map[pl_sd->bl.m].flag.nowarp)
continue; continue;
@ -2964,12 +2958,9 @@ int buildin_warpparty(struct script_state *st)
} }
else if(strcmp(str,"SavePointAll")==0) else if(strcmp(str,"SavePointAll")==0)
{ {
if(map[sd->bl.m].flag.noreturn) for (i = 0; i < MAX_PARTY; i++)
return 0;
for (i = 0; i < users; i++)
{ {
if ((pl_sd = pl_allsd[i]) && pl_sd->status.party_id == p) if ((pl_sd = p->member[i].sd))
{ {
if(map[pl_sd->bl.m].flag.noreturn) if(map[pl_sd->bl.m].flag.noreturn)
continue; continue;
@ -2979,15 +2970,16 @@ int buildin_warpparty(struct script_state *st)
} }
else if(strcmp(str,"SavePoint")==0) else if(strcmp(str,"SavePoint")==0)
{ {
if(map[sd->bl.m].flag.noreturn) pl_sd=script_rid2sd(st);
return 0; if (!pl_sd) return 0;
mapindex=sd->status.save_point.map; mapindex=pl_sd->status.save_point.map;
x=sd->status.save_point.x; x=pl_sd->status.save_point.x;
y=sd->status.save_point.y; y=pl_sd->status.save_point.y;
for (i = 0; i < users; i++)
for (i = 0; i < MAX_PARTY; i++)
{ {
if ((pl_sd = pl_allsd[i]) && pl_sd->status.party_id == p) if ((pl_sd = p->member[i].sd))
{ {
if(map[pl_sd->bl.m].flag.noreturn) if(map[pl_sd->bl.m].flag.noreturn)
continue; continue;
@ -2998,9 +2990,11 @@ int buildin_warpparty(struct script_state *st)
else else
{ {
mapindex = mapindex_name2id(str); mapindex = mapindex_name2id(str);
for (i = 0; i < users; i++) if (!mapindex) //Show source of npc error.
return 1;
for (i = 0; i < MAX_PARTY; i++)
{ {
if ((pl_sd = pl_allsd[i]) && pl_sd->status.party_id == p) if ((pl_sd = p->member[i].sd))
{ {
if(map[pl_sd->bl.m].flag.noreturn || map[pl_sd->bl.m].flag.nowarp) if(map[pl_sd->bl.m].flag.noreturn || map[pl_sd->bl.m].flag.nowarp)
continue; continue;