Фикс рендера трассеров с тикрейтом ниже 25

This commit is contained in:
Vigers Ray 2024-12-11 18:51:29 +03:00
parent 4309b24a76
commit 1bcfa3af91
5 changed files with 14 additions and 10 deletions

View file

@ -111,8 +111,7 @@ public sealed partial class GunSystem : SharedGunSystem
private void OnHitscan(HitscanEvent ev)
{
const float tracerInterval = 0.01f;
var activeTracers = new Dictionary<int, EntityUid>();
const double tracerInterval = 0.01f;
foreach (var a in ev.Sprites)
{
@ -137,13 +136,7 @@ public sealed partial class GunSystem : SharedGunSystem
Timer.Spawn(TimeSpan.FromSeconds(delay), () =>
{
if (activeTracers.TryGetValue(localIndex, out var existingTracer) && EntityManager.EntityExists(existingTracer))
{
EntityManager.DeleteEntity(existingTracer);
}
var tracerEntity = CreateTracerEffect(stepCoords, a.angle, rsi);
activeTracers[localIndex] = tracerEntity;
CreateTracerEffect(stepCoords, a.angle, rsi);
});
stepIndex++;
@ -179,6 +172,7 @@ public sealed partial class GunSystem : SharedGunSystem
KeyFrames =
{
new AnimationTrackSpriteFlick.KeyFrame(rsi.RsiState, 0f),
new AnimationTrackSpriteFlick.KeyFrame("empty", 0.02f),
}
}
}

View file

@ -7784,3 +7784,10 @@
type: Tweak
id: 547
time: '2024-12-11T01:59:58.794183+00:00'
- author: VigersRay
changes:
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u0440\u0435\u043D\
\u0434\u0435\u0440 \u0441\u043D\u0430\u0440\u044F\u0434\u043E\u0432."
type: Fix
id: 548
time: '2024-12-11T15:51:17.560149+00:00'

View file

@ -3,7 +3,7 @@
categories: [ HideSpawnMenu ]
components:
- type: TimedDespawn
lifetime: 0.05
lifetime: 0.5
- type: Sprite
drawdepth: Effects
layers:

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

View file

@ -54,6 +54,9 @@
},
{
"name": "blue_laser"
},
{
"name": "empty"
}
]
}