Reflect Damage Check cannot go above 966k

bWolfie

I'm the man
Messages
850
Points
0
Location
Alberta, Midgard
Github
bWolfie
Emulator
Hello,

I have made the following edit to status_damage in status.c.
When reflect damage is passed onto Crusader devoting player, I want it to not allow overflow above 1,000,000. However, there is some strange behavior.

Even though passed on damage can be any amount, this check can't seem to be above 966,959. If I make it higher than 966k, the check doesn't go through, even if reflect damage is in the millions.

Below is the code I'm using, labelled CUSTOM START / END

Thanks
 

Code:
#ifdef DEVOTION_REFLECT_DAMAGE
			if (src && (sce = sc->data[SC_DEVOTION]) != NULL) {
				struct block_list *d_bl = map->id2bl(sce->val1);
				struct mercenary_data *d_md = BL_CAST(BL_MER, d_bl);
				struct map_session_data *d_sd = BL_CAST(BL_PC, d_bl);

				if (d_bl != NULL
				 && ((d_md != NULL && d_md->master != NULL && d_md->master->bl.id == target->id)
				  || (d_sd != NULL && d_sd->devotion[sce->val2] == target->id))
				 && check_distance_bl(target, d_bl, sce->val3)
				) {
					// CUSTOM START
					if (hp > 1000000)
						hp = 1000000;
					// CUSTOM END
					clif->damage(d_bl, d_bl, 0, 0, hp, 0, BDT_NORMAL, 0);
					status_fix_damage(NULL, d_bl, hp, 0);
					return 0;
				}
				status_change_end(target, SC_DEVOTION, INVALID_TIMER);
			}
#endif

 
Last edited by a moderator:
Back
Top