Added error reporting to buildin_warp when it fails.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11727 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
1aa71f445e
commit
2d71189702
@ -3,6 +3,8 @@ Date Added
|
|||||||
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
|
|
||||||
|
2007/11/14
|
||||||
|
* Added error reporting to buildin_warp when it fails [ultramage]
|
||||||
2007/11/13
|
2007/11/13
|
||||||
* Fixed homunculus skills having unlimited range instead of being
|
* Fixed homunculus skills having unlimited range instead of being
|
||||||
capped to view_distance+1 (for details see bugreport:376) [ultramage]
|
capped to view_distance+1 (for details see bugreport:376) [ultramage]
|
||||||
|
@ -3443,16 +3443,12 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Set's a player position.
|
* Set's a player position.
|
||||||
* Return values:
|
* Return values:
|
||||||
* 0 - Success.
|
* 0 - Success.
|
||||||
* 1 - Invalid map index.
|
* 1 - Invalid map index.
|
||||||
* 2 - Map not in this map-server, and failed to locate alternate map-server.
|
* 2 - Map not in this map-server, and failed to locate alternate map-server.
|
||||||
* 3 - Failed to warp player because it was in transition between maps.
|
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, uint8 clrtype)
|
int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, uint8 clrtype)
|
||||||
{
|
{
|
||||||
|
@ -4267,23 +4267,29 @@ BUILDIN_FUNC(rand)
|
|||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
BUILDIN_FUNC(warp)
|
BUILDIN_FUNC(warp)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
int x,y;
|
int x,y;
|
||||||
const char *str;
|
const char* str;
|
||||||
TBL_PC *sd=script_rid2sd(st);
|
TBL_PC* sd = script_rid2sd(st);
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
str=script_getstr(st,2);
|
str = script_getstr(st,2);
|
||||||
x=script_getnum(st,3);
|
x = script_getnum(st,3);
|
||||||
y=script_getnum(st,4);
|
y = script_getnum(st,4);
|
||||||
|
|
||||||
if(strcmp(str,"Random")==0)
|
if(strcmp(str,"Random")==0)
|
||||||
pc_randomwarp(sd,3);
|
ret = pc_randomwarp(sd,3);
|
||||||
else if(strcmp(str,"SavePoint")==0){
|
else if(strcmp(str,"SavePoint")==0 || strcmp(str,"Save")==0)
|
||||||
pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
|
ret = pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
|
||||||
}else if(strcmp(str,"Save")==0){
|
else
|
||||||
pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3);
|
ret = pc_setpos(sd,mapindex_name2id(str),x,y,0);
|
||||||
}else
|
|
||||||
pc_setpos(sd,mapindex_name2id(str),x,y,0);
|
if( ret ) {
|
||||||
|
ShowError("buildin_warp: moving player '%s' to \"%s\",%d,%d failed.\n", sd->status.name, str, x, y);
|
||||||
|
script_reportsrc(st);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user