diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-02-18 23:10:08 +0100 |
---|---|---|
committer | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-02-18 23:10:08 +0100 |
commit | 676733d1ee6aceca40b11fde83a8c8b6e0e058d2 (patch) | |
tree | b0a3188098f87487bf2e078f88d13918510dff80 /src | |
parent | 9106bbab19b4feaa4623a3b8e5d59e08ef73b640 (diff) | |
download | hercules-676733d1ee6aceca40b11fde83a8c8b6e0e058d2.tar.gz hercules-676733d1ee6aceca40b11fde83a8c8b6e0e058d2.tar.bz2 hercules-676733d1ee6aceca40b11fde83a8c8b6e0e058d2.tar.xz hercules-676733d1ee6aceca40b11fde83a8c8b6e0e058d2.zip |
Add new return values to pc_setpos() function
* 3 - No character data. (Parameter sd is a NULL pointer.)
* 4 - Character is jailed.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/pc.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index c96e957c7..355ae0b16 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5688,18 +5688,26 @@ static int pc_steal_coin(struct map_session_data *sd, struct block_list *target, return 0; } -/*========================================== - * Set's a player position. - * Return values: - * 0 - Success. - * 1 - Invalid map index. - * 2 - Map not in this map-server, and failed to locate alternate map-server. - *------------------------------------------*/ + /** + * Sets a character's position. + * + * @param sd The related character. + * @param map_index The target map's index. + * @param x The target x-coordinate. + * @param y The target y-coordinate. + * @param clrtype The unit clear type, which should be used. + * @retval 0 Success. + * @retval 1 Invalid map index. + * @retval 2 Map not in this map-server, and failed to locate alternative map-server. + * @retval 3 No character data. (Parameter sd is a NULL pointer.) + * @retval 4 Character is jailed. + * + **/ static int pc_setpos(struct map_session_data *sd, unsigned short map_index, int x, int y, enum clr_type clrtype) { int16 m; - nullpo_ret(sd); + nullpo_retr(3, sd); if( !map_index || !mapindex_id2name(map_index) || ( m = map->mapindex2mapid(map_index) ) == -1 ) { ShowDebug("pc_setpos: Passed mapindex(%d) is invalid!\n", map_index); @@ -5788,7 +5796,7 @@ static int pc_setpos(struct map_session_data *sd, unsigned short map_index, int map->cellfromcache(&map->list[m]); if (sd->sc.count) { // Cancel some map related stuff. if (sd->sc.data[SC_JAILED]) - return 1; //You may not get out! + return 4; //You may not get out! status_change_end(&sd->bl, SC_CASH_BOSS_ALARM, INVALID_TIMER); status_change_end(&sd->bl, SC_WARM, INVALID_TIMER); status_change_end(&sd->bl, SC_SUN_COMFORT, INVALID_TIMER); |