LabAPI
LabAPI copied to clipboard
[BUG]: AntiScp207 effects can cause players to take abnormal AHP loss
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
- Give the player a CreateAhpProcess with amount/limit = 75
- Apply the AntiScp207 effect to the player
- Wait until the player’s AHP reaches its maximum value
- Attack the player
- 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
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.
Actually CreateAhpProcess is not related to the bug. It's just AntiScp207's problem.