Describe the bug
When being hit with a shovel you can die instantly even though you have regenerated back to 100HP. Bug only occurs if hit by shovel multiple times, base game death always occurs on the 4th (maybe 5th) hit, that same hit will be fatal regardless of HP.
To Reproduce
Steps to reproduce the behavior:
Have 2 players online, with a shovel
Player 1 put 5 points in HP regen
Player 2 hits Player 1 only when HP has regenerated back to 100 HP
On the 4th/6th hit Player 1 will die with 100HP
Expected behavior
Hits should only do the damage they apply and not force instantaneous death
Screenshots
If applicable, add screenshots to help explain your problem.
Mod list:
Lethal Progression
Additional context
The error occurs due to the IHittable.Hit function running server-side.
DamageOnOtherClients(damageAmount, newHealthAmount);
if (base.IsOwner && isPlayerControlled)
{
CentipedeAI[] array = UnityEngine.Object.FindObjectsByType<CentipedeAI>(FindObjectsSortMode.None);
for (int i = 0; i < array.Length; i++)
{
if (array[i].clingingToPlayer == this)
{
return;
}
}
DamagePlayer(damageAmount, hasDamageSFX: true, callRPC: false, CauseOfDeath.Bludgeoning);
}
In the code above, the Host runs DamageOnOtherClients and updates the Player's HP based off of it's own understanding of the HP and not the Player's regenerated HP.
To fix this issue, the Host (at minimum) will need to track a player's HP regeneration and update their HP accordingly, or alternatively a new RPC will need to be added for a client to inform the server of it's new HP value.
Mod Version v1.7.X
Describe the bug When being hit with a shovel you can die instantly even though you have regenerated back to 100HP. Bug only occurs if hit by shovel multiple times, base game death always occurs on the 4th (maybe 5th) hit, that same hit will be fatal regardless of HP.
To Reproduce Steps to reproduce the behavior:
Expected behavior Hits should only do the damage they apply and not force instantaneous death
Screenshots If applicable, add screenshots to help explain your problem.
Mod list: Lethal Progression
Additional context The error occurs due to the
IHittable.Hit
function running server-side.In the code above, the Host runs
DamageOnOtherClients
and updates the Player's HP based off of it's own understanding of the HP and not the Player's regenerated HP.To fix this issue, the Host (at minimum) will need to track a player's HP regeneration and update their HP accordingly, or alternatively a new RPC will need to be added for a client to inform the server of it's new HP value.