Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from Corvax-Frontier/Zekins3366-patch-1
Browse files Browse the repository at this point in the history
Пу-пу-пу
  • Loading branch information
Zekins3366 authored Apr 16, 2024
2 parents c69e122 + ffccace commit df68d64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ public sealed partial class SolutionRegenerationComponent : Component
/// </summary>
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(5);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ public sealed class SolutionRegenerationSystem : EntitySystem
{
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly IGameTiming _timing = default!;
private TimeSpan _updateTime = TimeSpan.Zero;

public override void Update(float frameTime)
{
base.Update(frameTime);

if (_updateTime > _timing.CurTime)
return;
_updateTime = _timing.CurTime + TimeSpan.FromSeconds(0.5);

var query = EntityQueryEnumerator<SolutionRegenerationComponent, SolutionContainerManagerComponent>();
while (query.MoveNext(out var uid, out var regen, out var manager))
Expand Down

0 comments on commit df68d64

Please sign in to comment.