Переглянути джерело

* 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://svn.code.sf.net/p/rathena/svn/trunk@14837 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 роки тому
батько
коміт
4356e5fdbc
2 змінених файлів з 2 додано та 1 видалено
  1. 1 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/status.c

+ 1 - 0
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]

+ 1 - 1
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;