From 1edbaf25c049c76c4566b7919bb613d8a2a51176 Mon Sep 17 00:00:00 2001 From: Paradox924X Date: Wed, 22 Jul 2009 18:46:44 +0000 Subject: Added proper bounds of INT_MIN to INT_MAX for hp/sp when being sent to/from status_damage/status_heal for negative values because of INT_MAX being (-INT_MIN - 1). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13955 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/status.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index eb480bc2c..857a0a7a7 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -637,12 +637,12 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s sp = 0; //Not a valid SP target. if (hp < 0) { //Assume absorbed damage. - status_heal(target, -hp, 0, 1); + status_heal(target, cap_value(-hp, INT_MIN, INT_MAX), 0, 1); hp = 0; } if (sp < 0) { - status_heal(target, 0, -sp, 1); + status_heal(target, 0, cap_value(-sp, INT_MIN, INT_MAX), 1); sp = 0; } @@ -859,7 +859,7 @@ int status_heal(struct block_list *bl,int hp,int sp, int flag) sc = NULL; if (hp < 0) { - status_damage(NULL, bl, -hp, 0, 0, 1); + status_damage(NULL, bl, cap_value(-hp, INT_MIN, INT_MAX), 0, 0, 1); hp = 0; } @@ -872,7 +872,7 @@ int status_heal(struct block_list *bl,int hp,int sp, int flag) } if(sp < 0) { - status_damage(NULL, bl, 0, -sp, 0, 1); + status_damage(NULL, bl, 0, cap_value(-sp, INT_MIN, INT_MAX), 0, 1); sp = 0; } -- cgit v1.2.3-70-g09d2