summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-05-24 12:39:01 -0300
committerpanikon <panikon@zoho.com>2014-05-24 12:39:01 -0300
commit9089ea1e9998663f0573abca89ed542f19418b11 (patch)
treea7e5e622ab4e75982e97d323bf567480cbcf5feb /src
parentb0ad74f6384c1a23715fc1a3256190f4053f8756 (diff)
downloadhercules-9089ea1e9998663f0573abca89ed542f19418b11.tar.gz
hercules-9089ea1e9998663f0573abca89ed542f19418b11.tar.bz2
hercules-9089ea1e9998663f0573abca89ed542f19418b11.tar.xz
hercules-9089ea1e9998663f0573abca89ed542f19418b11.zip
Fixed issue in [AT](un)jail when jailing players in sec_pri (issue: 8206) http://hercules.ws/board/tracker/issue-8206-jail-bug/
Diffstat (limited to 'src')
-rw-r--r--src/map/status.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/map/status.c b/src/map/status.c
index a1a7e1969..a716b8913 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -8243,7 +8243,14 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
tick_time = 1000; // [GodLesZ] tick time
break;
case SC_JAILED:
- //Val1 is duration in minutes. Use INT_MAX to specify 'unlimited' time.
+ // val1 is duration in minutes. Use INT_MAX to specify 'unlimited' time.
+ // When first called:
+ // val2 Jail map_index
+ // val3 x
+ // val4 y
+ // When renewing status' information
+ // val3 Return map_index
+ // val4 return coordinates
tick = val1>0?1000:250;
if (sd)
{
@@ -8256,7 +8263,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
//2. Set restore point (val3 -> return map, val4 return coords
val3 = map_index;
val4 = pos;
- } else if (!val3 || val3 == sd->mapindex) { //Use save point.
+ } else if (!val3
+ || val3 == sd->mapindex
+ || !sd->sc.data[SC_JAILED] // If player is being jailed and is already in jail (issue: 8206)
+ ) { //Use save point.
val3 = sd->status.save_point.map;
val4 = (sd->status.save_point.x&0xFFFF)
|(sd->status.save_point.y<<16);