Bunch of revolver fixes (#19649)

* Bunch of revolver fixes

Some stuff wasn't working with prediction so this should fix all of it.

* a

* fix weh

* Also usedelay
This commit is contained in:
metalgearsloth
2024-01-21 22:16:46 +11:00
committed by GitHub
parent 15f91b0720
commit 9bb2781bfc
5 changed files with 95 additions and 46 deletions

View File

@@ -58,11 +58,11 @@ public sealed partial class GunSystem
RaiseLocalEvent(uid, ev, false);
}
protected override void UpdateAmmoCount(EntityUid uid)
protected override void UpdateAmmoCount(EntityUid uid, bool prediction = true)
{
// Don't use resolves because the method is shared and there's no compref and I'm trying to
// share as much code as possible
if (!Timing.IsFirstTimePredicted ||
if (prediction && !Timing.IsFirstTimePredicted ||
!TryComp<AmmoCounterComponent>(uid, out var clientComp))
{
return;
@@ -98,7 +98,7 @@ public sealed partial class GunSystem
{
MinHeight = 15;
HorizontalExpand = true;
VerticalAlignment = VAlignment.Center;
VerticalAlignment = Control.VAlignment.Center;
AddChild(new BoxContainer
{
Orientation = BoxContainer.LayoutOrientation.Vertical,
@@ -213,7 +213,7 @@ public sealed partial class GunSystem
{
MinHeight = 15;
HorizontalExpand = true;
VerticalAlignment = VAlignment.Center;
VerticalAlignment = Control.VAlignment.Center;
AddChild(new BoxContainer
{
@@ -300,7 +300,7 @@ public sealed partial class GunSystem
{
MinHeight = 15;
HorizontalExpand = true;
VerticalAlignment = VAlignment.Center;
VerticalAlignment = Control.VAlignment.Center;
AddChild(new BoxContainer
{
@@ -419,7 +419,7 @@ public sealed partial class GunSystem
{
MinHeight = 15;
HorizontalExpand = true;
VerticalAlignment = VAlignment.Center;
VerticalAlignment = Control.VAlignment.Center;
AddChild((_bulletsList = new BoxContainer
{
Orientation = BoxContainer.LayoutOrientation.Horizontal,