LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[BUG]: AntiScp207 effects can cause players to take abnormal AHP loss

Open CCrous opened this issue 8 months ago • 2 comments

Before You Report

  • [x] I have searched for existing reports of this bug, and this bug report is unique.

Version

14.2.6

Description

After CreateAhpProcess grants an AHP to a player, if the player has the Anti207 effect, the player's AHP will not be consumed, but will still reduce damage

To Reproduce

  1. Give the player a CreateAhpProcess with amount/limit = 75
  2. Apply the AntiScp207 effect to the player
  3. Wait until the player’s AHP reaches its maximum value
  4. Attack the player
  5. Observe that the player’s AHP does not decrease, but the damage value is still reduced according to efficacy

Expected Behavior

The player's AHP can be consumed normally

Additional Information

my test example code

Image

CCrous avatar Mar 31 '26 18:03 CCrous

Same problem.

// CustomPlayerEffects.AntiScp207
// Token: 0x06003232 RID: 12850 RVA: 0x000A86CC File Offset: 0x000A68CC
public DamageHandlerBase.HandlerOutput SimulateHandlerOutput(HealthStat healthStat, AhpStat ahpStat, HumeShieldStat humeShieldStat, DamageHandlerBase dhb)
{
	float curValue = healthStat.CurValue;
	float curValue2 = ahpStat.CurValue;
	float curValue3 = humeShieldStat.CurValue;
	this._simulating = true;
	DamageHandlerBase.HandlerOutput handlerOutput = dhb.ApplyDamage(base.Hub);
	this._simulating = false;
	if (this._ahpProcess != null && ahpStat.CurValue <= 0f)
	{
		this._ahpProcess.DecayRate = 0f;
	}
	healthStat.CurValue = curValue;
	ahpStat.ServerAddProcessValue(curValue2); //SHOULD BE????
	humeShieldStat.CurValue = curValue3;
	return handlerOutput;
}

Here is the source code of AntiScp207 damage simulation. AHP shouldn't be added back. Instead, save every ahp process's current amount, after simulation, restore those ahp processes.

Pro845627 avatar Apr 08 '26 13:04 Pro845627

Actually CreateAhpProcess is not related to the bug. It's just AntiScp207's problem.

Pro845627 avatar Apr 08 '26 13:04 Pro845627