Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix No Blood Regeneration #689

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public sealed partial class BloodstreamComponent : Component
/// If this is true, the entity will not passively regenerate blood,
/// and instead will slowly lose blood.
/// </summary>
[DataField]
public bool HasBloodDeficiency = false;

/// <summary>
Expand Down
9 changes: 6 additions & 3 deletions Content.Server/Body/Systems/BloodstreamSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,15 @@ public override void Update(float frameTime)

// Removes blood for Blood Deficiency constantly.
if (bloodstream.HasBloodDeficiency)
{
if (!_mobStateSystem.IsDead(uid))
RemoveBlood(uid, bloodstream.BloodDeficiencyLossAmount, bloodstream);
}
// Adds blood to their blood level if it is below the maximum.
else if (bloodSolution.Volume < bloodSolution.MaxVolume)
if (!_mobStateSystem.IsDead(uid))
TryModifyBloodLevel(uid, bloodstream.BloodRefreshAmount, bloodstream);
else if (bloodSolution.Volume < bloodSolution.MaxVolume && !_mobStateSystem.IsDead(uid))
{
TryModifyBloodLevel(uid, bloodstream.BloodRefreshAmount, bloodstream);
}

// Removes blood from the bloodstream based on bleed amount (bleed rate)
// as well as stop their bleeding to a certain extent.
Expand Down
Loading