summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-12-03 18:54:39 +0100
committerHaru <haru@dotalux.com>2017-12-03 18:54:39 +0100
commite259ba1a0f508d11a525fb5bde1d03bf2948ff9b (patch)
treebbc6b8960bfc168f54fac4e74abb9c457d96a22b /src/map/status.c
parent00624f157bdee3bd438bd7d9ecd4aed03815c23e (diff)
downloadhercules-e259ba1a0f508d11a525fb5bde1d03bf2948ff9b.tar.gz
hercules-e259ba1a0f508d11a525fb5bde1d03bf2948ff9b.tar.bz2
hercules-e259ba1a0f508d11a525fb5bde1d03bf2948ff9b.tar.xz
hercules-e259ba1a0f508d11a525fb5bde1d03bf2948ff9b.zip
Fix an issue that prevents the Poison status to naturally end when Slow Poison is active
The status change timer wasn't correctly rearmed in such a condition, keeping SC_POISON active indefinitely. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/map/status.c b/src/map/status.c
index e0893aa36..48fd03135 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -11542,24 +11542,26 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data)
break;
case SC_POISON:
- if(st->hp <= max(st->max_hp>>2, sce->val4)) //Stop damaging after 25% HP left.
+ if (st->hp <= max(st->max_hp / 4, sce->val4)) //Stop damaging after 25% HP left.
break;
FALLTHROUGH
case SC_DPOISON:
if (--(sce->val3) > 0) {
- if (!sc->data[SC_SLOWPOISON]) {
- if( sce->val2 && bl->type == BL_MOB ) {
- struct block_list* src = map->id2bl(sce->val2);
- if (src != NULL)
- mob->log_damage(BL_UCAST(BL_MOB, bl), src, sce->val4);
- }
- map->freeblock_lock();
- status_zap(bl, sce->val4, 0);
- if (sc->data[type]) { // Check if the status still last ( can be dead since then ).
- sc_timer_next(1000 + tick, status->change_timer, bl->id, data );
- }
- map->freeblock_unlock();
+ if (sc->data[SC_SLOWPOISON] != NULL) {
+ sc_timer_next(1000 + tick, status->change_timer, bl->id, data);
+ return 0;
}
+ if (sce->val2 != 0 && bl->type == BL_MOB) {
+ struct block_list* src = map->id2bl(sce->val2);
+ if (src != NULL)
+ mob->log_damage(BL_UCAST(BL_MOB, bl), src, sce->val4);
+ }
+ map->freeblock_lock();
+ status_zap(bl, sce->val4, 0);
+ if (sc->data[type] != NULL) { // Check if the status still last (can be dead since then).
+ sc_timer_next(1000 + tick, status->change_timer, bl->id, data);
+ }
+ map->freeblock_unlock();
return 0;
}
break;