* Fixed script command 'warpwaitingpc' not checking, whether or not the player still has required amount of Zeny (since r14765).

- Fixed warping through 'warpwaitingpc' to savepoint would take the fee twice ( missing {} ).
- Fixed random warping through 'warpwaitingpc' would not take away fee Zeny at all.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14772 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ai4rei
2011-04-06 16:06:28 +00:00
parent 0917639f81
commit fbb16c5ccb
2 changed files with 36 additions and 5 deletions

View File

@@ -1,6 +1,9 @@
Date Added
2011/04/06
* Fixed script command 'warpwaitingpc' not checking, whether or not the player still has required amount of Zeny (since r14765). [Ai4rei]
- Fixed warping through 'warpwaitingpc' to savepoint would take the fee twice ( missing {} ).
- Fixed random warping through 'warpwaitingpc' would not take away fee Zeny at all.
* STABLE IS NOW THE OLD TRUNK. THE NEW TRUNK IS NOW FOR BLEEDING-EDGE AND/OR UNTESTED CHANGES. [Paradox924X]
2011/04/05
* Moved detection of monotonic clock support to the configure script, which also checks, whether or not it actually works (bugreport:1003, related r11912 and r11983). [Ai4rei]

View File

@@ -9262,9 +9262,13 @@ BUILDIN_FUNC(globalmes)
return 0;
}
/*==========================================
* Creates a waiting room (chat room)
*------------------------------------------*/
/////////////////////////////////////////////////////////////////////
// NPC waiting room (chat room)
//
/// Creates a waiting room (chat room) for this npc.
///
/// waitingroom "<title>",<limit>{,"<event>"{,<trigger>{,<zeny>{,<minlvl>{,<maxlvl>}}}}};
BUILDIN_FUNC(waitingroom)
{
struct npc_data* nd;
@@ -9453,20 +9457,44 @@ BUILDIN_FUNC(warpwaitingpc)
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
pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
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
pc_setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT);
{
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;