Skip to content

Commit ecd7917

Browse files
committed
lint
1 parent 8cd6d26 commit ecd7917

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

OpenDreamClient/Rendering/ClientAppearanceSystem.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Robust.Shared.Map;
1313
using Robust.Shared.Timing;
1414
using Robust.Shared.Asynchronous;
15+
using System.Threading;
1516
using System.Threading.Tasks;
1617

1718
namespace OpenDreamClient.Rendering;
@@ -58,7 +59,7 @@ public int GetAnimationFrame(IGameTiming gameTiming) {
5859
private readonly Dictionary<(int X, int Y, int Z), Flick> _turfFlicks = new();
5960
private readonly Dictionary<EntityUid, Flick> _movableFlicks = new();
6061
private bool _receivedAllAppearancesMsg;
61-
private readonly float timeToRefreshVerbs = 3f;
62+
private readonly float _timeToRefreshVerbs = 3f;
6263

6364
[Dependency] private readonly IEntityManager _entityManager = default!;
6465
[Dependency] private readonly IDreamResourceManager _dreamResourceManager = default!;
@@ -83,7 +84,7 @@ public override void Initialize() {
8384
SubscribeNetworkEvent<FlickEvent>(OnFlick);
8485
SubscribeLocalEvent<DMISpriteComponent, WorldAABBEvent>(OnWorldAABB);
8586

86-
_ = StartVerbRefresher();
87+
_ = StartVerbRefresher(new());
8788
}
8889

8990
public override void Shutdown() {
@@ -371,9 +372,12 @@ public string GetName(ClientObjectReference reference) {
371372
return _movableFlicks.GetValueOrDefault(entity);
372373
}
373374

374-
private async Task StartVerbRefresher() {
375+
private async Task StartVerbRefresher(CancellationTokenSource cancelSource) {
375376
while (true) {
376-
await Task.Delay(TimeSpan.FromSeconds(timeToRefreshVerbs));
377+
await Task.Delay(TimeSpan.FromSeconds(_timeToRefreshVerbs));
378+
if (cancelSource.IsCancellationRequested)
379+
break;
380+
377381
_taskManager.RunOnMainThread(_verbSystem.RefreshVerbs);
378382
}
379383
}

0 commit comments

Comments
 (0)