diff options
author | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-27 19:36:10 +0000 |
---|---|---|
committer | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-27 19:36:10 +0000 |
commit | eaae489aded873b4ad756a0d3e49b7384f8a899a (patch) | |
tree | 2d0b431ed8af5c5f84e4648758c8eb9cae92ea3b | |
parent | 7bc364399bfd259bde5408c9e16e8ba3d01ff29a (diff) | |
download | hercules-eaae489aded873b4ad756a0d3e49b7384f8a899a.tar.gz hercules-eaae489aded873b4ad756a0d3e49b7384f8a899a.tar.bz2 hercules-eaae489aded873b4ad756a0d3e49b7384f8a899a.tar.xz hercules-eaae489aded873b4ad756a0d3e49b7384f8a899a.zip |
* Fixed bugreport:3325, if bHPRecovRate was set to -100 you will actually regenerate 1 HP/SP and it shouldn't regenerate at all.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17051 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/status.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/map/status.c b/src/map/status.c index d4af092ad..7047906e1 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3296,7 +3296,7 @@ static unsigned short status_calc_ematk(struct block_list *,struct status_change void status_calc_regen(struct block_list *bl, struct status_data *status, struct regen_data *regen) { struct map_session_data *sd; - int val, skill; + int val, skill, reg_flag; if( !(bl->type&BL_REGEN) || !regen ) return; @@ -3307,7 +3307,9 @@ void status_calc_regen(struct block_list *bl, struct status_data *status, struct if( sd && sd->hprecov_rate != 100 ) val = val*sd->hprecov_rate/100; - regen->hp = cap_value(val, 1, SHRT_MAX); + reg_flag = bl->type == BL_PC ? 0 : 1; + + regen->hp = cap_value(val, reg_flag, SHRT_MAX); val = 1 + (status->int_/6) + (status->max_sp/100); if( status->int_ >= 120 ) @@ -3316,7 +3318,7 @@ void status_calc_regen(struct block_list *bl, struct status_data *status, struct if( sd && sd->sprecov_rate != 100 ) val = val*sd->sprecov_rate/100; - regen->sp = cap_value(val, 1, SHRT_MAX); + regen->sp = cap_value(val, reg_flag, SHRT_MAX); if( sd ) { |