From 8269fdcd5d036ddc3c24bc0ebb4ad958b5c19a3a Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 22 Apr 2018 21:02:00 +0200 Subject: Extend status->heal() with a flag to allow reviving a dead character This adds `STATUS_HEAL_ALLOWREVIVE` to `enum status_heal_flag`. Fixes an issue caused by a hack in the resurrection code, that would make characters respawn with 2 HP instead of 1. Signed-off-by: Haru --- src/map/status.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index a1be36ff4..edcdd515d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1555,7 +1555,9 @@ static int status_heal(struct block_list *bl, int64 in_hp, int64 in_sp, enum sta nullpo_ret(bl); st = status->get_status_data(bl); - if (st == &status->dummy || !st->hp) + if (st == &status->dummy) + return 0; + if (st->hp == 0 && (flag & STATUS_HEAL_ALLOWREVIVE) != 0) return 0; /* From here onwards, we consider it a 32-type as the client does not support higher and the value doesn't get through percentage modifiers */ -- cgit v1.2.3-70-g09d2