Fix time management bugs in RadiationPulseSystem (#4743)

This commit is contained in:
20kdc
2021-10-02 18:53:09 +01:00
committed by GitHub
parent 7a2bcefee1
commit 201b1bec89

View File

@@ -20,15 +20,16 @@ namespace Content.Server.Radiation
{ {
base.Update(frameTime); base.Update(frameTime);
_accumulator += RadiationCooldown; _accumulator += frameTime;
while (_accumulator > RadiationCooldown) while (_accumulator > RadiationCooldown)
{ {
_accumulator -= RadiationCooldown; _accumulator -= RadiationCooldown;
// All code here runs effectively every RadiationCooldown seconds, so use that as the "frame time".
foreach (var comp in EntityManager.EntityQuery<RadiationPulseComponent>(true)) foreach (var comp in EntityManager.EntityQuery<RadiationPulseComponent>(true))
{ {
comp.Update(frameTime); comp.Update(RadiationCooldown);
var ent = comp.Owner; var ent = comp.Owner;
if (ent.Deleted) continue; if (ent.Deleted) continue;