summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-06 16:55:59 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-06 16:55:59 +0000
commit5761fd23ff5523642dc8b24a80316b17c90535e9 (patch)
tree31d2f917bcdcbfceb488ae4103f94c1b6928aa71 /src
parent0a8d24ef2cb18c75f846acb3c57c4d90b2feadcd (diff)
downloadhercules-5761fd23ff5523642dc8b24a80316b17c90535e9.tar.gz
hercules-5761fd23ff5523642dc8b24a80316b17c90535e9.tar.bz2
hercules-5761fd23ff5523642dc8b24a80316b17c90535e9.tar.xz
hercules-5761fd23ff5523642dc8b24a80316b17c90535e9.zip
* Improved changes to script command 'waitingroom' from r14772.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14773 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c51
1 files changed, 13 insertions, 38 deletions
diff --git a/src/map/script.c b/src/map/script.c
index aad2e3049..72e99e8ef 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9447,54 +9447,29 @@ BUILDIN_FUNC(warpwaitingpc)
for( i = 0; i < n && cd->users > 0; i++ )
{
sd = cd->usersd[0];
- if( sd == NULL )
- {
- ShowDebug("script:warpwaitingpc: no user in chat room position 0 (cd->users=%d,%d/%d)\n", cd->users, i, n);
- mapreg_setreg(reference_uid(add_str("$@warpwaitingpc"), i), 0);
- continue;// Broken npc chat room?
+
+ if( strcmp(map_name,"SavePoint") == 0 && map[sd->bl.m].flag.noteleport )
+ {// can't teleport on this map
+ break;
+ }
+
+ if( cd->zeny )
+ {// fee set
+ if( (uint32)sd->status.zeny < cd->zeny )
+ {// no zeny to cover set fee
+ break;
+ }
+ pc_payzeny(sd, cd->zeny);
}
mapreg_setreg(reference_uid(add_str("$@warpwaitingpc"), i), sd->bl.id);
if( strcmp(map_name,"Random") == 0 )
- {
- if( cd->zeny )
- {// fee set
- if( (uint32)sd->status.zeny < cd->zeny )
- {// no zeny to cover set fee
- return 0;
- }
- pc_payzeny(sd, cd->zeny);
- }
pc_randomwarp(sd,CLR_TELEPORT);
- }
else if( strcmp(map_name,"SavePoint") == 0 )
- {
- if( map[sd->bl.m].flag.noteleport )
- return 0;// can't teleport on this map
-
- if( cd->zeny )
- {// fee set
- if( (uint32)sd->status.zeny < cd->zeny )
- {// no zeny to cover set fee
- return 0;
- }
- pc_payzeny(sd, cd->zeny);
- }
pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
- }
else
- {
- if( cd->zeny )
- {// fee set
- if( (uint32)sd->status.zeny < cd->zeny )
- {// no zeny to cover set fee
- return 0;
- }
- pc_payzeny(sd, cd->zeny);
- }
pc_setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT);
- }
}
mapreg_setreg(add_str("$@warpwaitingpcnum"), i);
return 0;