Fix sloth's disease shit (#7123)

This commit is contained in:
metalgearsloth
2022-03-15 07:51:42 +11:00
committed by GitHub
parent 4970a0ff71
commit 84225dde3d
7 changed files with 53 additions and 39 deletions

View File

@@ -47,15 +47,17 @@ public sealed class DiseaseOutbreak : StationEvent
var diseaseName = _random.Pick(NotTooSeriousDiseases);
if (!_prototypeManager.TryIndex(diseaseName, out DiseasePrototype? disease) || disease == null)
if (!_prototypeManager.TryIndex(diseaseName, out DiseasePrototype? disease))
return;
var diseaseSystem = EntitySystem.Get<DiseaseSystem>();
foreach (var target in targetList)
{
if (toInfect-- == 0)
break;
EntitySystem.Get<DiseaseSystem>().TryAddDisease(target, disease);
diseaseSystem.TryAddDisease(target.Owner, disease, target);
}
_chatManager.DispatchStationAnnouncement(Loc.GetString("station-event-disease-outbreak-announcement"));
}