Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Apr 13, 2024
1 parent 6f196ce commit d781c1d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
14 changes: 8 additions & 6 deletions Content.Server/Backmen/Disease/DiseaseSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public override void Update(float frameTime)
_parallel.ProcessNow(new DiseaseJob
{
System = this,
Owner = (owner, carrierComp),
Owner = (owner, carrierComp, mobState),
FrameTime = frameTime
}, carrierComp.Diseases.Count);
}
Expand All @@ -136,25 +136,25 @@ public override void Update(float frameTime)
private record struct DiseaseJob : IParallelRobustJob
{
public DiseaseSystem System { get; init; }
public Entity<DiseaseCarrierComponent> Owner { get; init; }
public Entity<DiseaseCarrierComponent, MobStateComponent> Owner { get; init; }
public float FrameTime { get; init; }
public void Execute(int index)
{
System.Process(Owner, FrameTime, index);
}
}

private void Process(Entity<DiseaseCarrierComponent> owner, float frameTime, int i)
private void Process(Entity<DiseaseCarrierComponent, MobStateComponent> owner, float frameTime, int i)
{
var disease = owner.Comp.Diseases[i];
var disease = owner.Comp1.Diseases[i];
disease.Accumulator += frameTime;
disease.TotalAccumulator += frameTime;

if (disease.Accumulator < disease.TickTime)
return;

// if the disease is on the silent disease list, don't do effects
var doEffects = owner.Comp.CarrierDiseases?.Contains(disease.ID) != true;
var doEffects = owner.Comp1.CarrierDiseases?.Contains(disease.ID) != true;
disease.Accumulator -= disease.TickTime;

var stage = 0; //defaults to stage 0 because you should always have one
Expand All @@ -181,9 +181,11 @@ private void Process(Entity<DiseaseCarrierComponent> owner, float frameTime, int
{
Log.Error(err.ToString());
}

}

if (_mobStateSystem.IsIncapacitated(owner, owner))
doEffects = false;

if (!doEffects)
return;

Expand Down
8 changes: 8 additions & 0 deletions Resources/Prototypes/Backmen/Diseases/noninfectious.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@
stages:
- 2
# possible xeno polymorph
- !type:DiseasePolymorph
probability: 0.050
polymorphId: XenoDroneMorph
polymorphMessage: disease-xeno-polymorph
polymorphSound:
path: /Audio/Animals/space_dragon_roar.ogg
stages:
- 2
- !type:DiseasePolymorph
probability: 0.0015
polymorphId: XenoQueenMorph
Expand Down
7 changes: 0 additions & 7 deletions Resources/Prototypes/Reagents/toxins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,6 @@
min: 5
causeChance: 0.3
disease: XenoVirus
- !type:ChemCauseDisease
conditions:
- !type:ReagentThreshold
reagent: FluorosulfuricAcid
min: 5
causeChance: 0.7
disease: XenoDroneVirus
# end-backmen: Disease

- type: reagent
Expand Down

0 comments on commit d781c1d

Please sign in to comment.