From 7badbcba4e7ad1c46f0438d1535f77e4cbbc6fd7 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Sun, 29 May 2011 13:43:51 +0000 Subject: * Fixed NULL pointer in status_change_timer (SC_BERSERK), when the HP subtraction causes the HP drop below 100, but does not exceed remaining HP (bugreport:1150, related r8705, r11786 and r12061). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14837 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 1 + src/map/status.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index c67753689..85a685337 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,6 +1,7 @@ Date Added 2011/05/29 + * Fixed NULL pointer in status_change_timer (SC_BERSERK), when the HP subtraction causes the HP drop below 100, but does not exceed remaining HP (bugreport:1150, related r8705, r11786 and r12061). [Ai4rei] * Updated script commands 'npcshopitem', 'npcshopadditem' and 'npcshopdelitem' to support cashshops as well (bugreport:4928). [Ai4rei] * Fixed players could add themselves to their friendslist through their clones or WPE (bugreport:4909). [Ai4rei] * Fixed bonus 'bHPDrainValue' on left hand would work as right hand bonus, when specified with 'bonus' rather than 'bonus2' (bugreport:4939, since r6221). [Ai4rei] diff --git a/src/map/status.c b/src/map/status.c index d9a14dc23..e055c46d3 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7261,7 +7261,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data) case SC_BERSERK: // 5% every 10 seconds [DracoRPG] - if(--(sce->val3)>0 && status_charge(bl, sce->val2, 0)) + if( --( sce->val3 ) > 0 && status_charge(bl, sce->val2, 0) && status->hp > 100 ) { sc_timer_next(sce->val4+tick, status_change_timer, bl->id, data); return 0; -- cgit v1.2.3-70-g09d2