summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-03-08 23:36:43 +0100
committerGitHub <noreply@github.com>2020-03-08 23:36:43 +0100
commit4fef829adaea914e9de3e1854551cbe99d22f703 (patch)
treed098e0d8fabb5c62cd9d6d205e36658672f12b92 /src/map
parent6c15f3350056419feeb071ff871864bb5184d28d (diff)
parent676733d1ee6aceca40b11fde83a8c8b6e0e058d2 (diff)
downloadhercules-4fef829adaea914e9de3e1854551cbe99d22f703.tar.gz
hercules-4fef829adaea914e9de3e1854551cbe99d22f703.tar.bz2
hercules-4fef829adaea914e9de3e1854551cbe99d22f703.tar.xz
hercules-4fef829adaea914e9de3e1854551cbe99d22f703.zip
Merge pull request #2633 from Kenpachi2k13/pc_setpos_return_values
Add new return values to pc_setpos() function
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c26
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);