]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Predict AME Fuel Examine (#38018)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Tue, 3 Jun 2025 11:51:50 +0000 (13:51 +0200)
committerGitHub <noreply@github.com>
Tue, 3 Jun 2025 11:51:50 +0000 (13:51 +0200)
* init

* :)

Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Content.Shared/Ame/Components/AmeFuelContainerComponent.cs

index ff6cdd2da77a76bc0ed39f11731a822325b3134b..a2e25f269a6ac8f96331fc3cf9949b3d00ccff68 100644 (file)
@@ -107,7 +107,12 @@ public sealed class AmeControllerSystem : EntitySystem
                 var powerOutput = group.InjectFuel(availableInject, out var overloading);
                 if (TryComp<PowerSupplierComponent>(uid, out var powerOutlet))
                     powerOutlet.MaxSupply = powerOutput;
+
                 fuelContainer.FuelAmount -= availableInject;
+
+                // Dirty for the sake of the AME fuel examine not mispredicting
+                Dirty(controller.FuelSlot.Item.Value, fuelContainer);
+
                 // only play audio if we actually had an injection
                 if (availableInject > 0)
                     _audioSystem.PlayPvs(controller.InjectSound, uid, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
index 455414597e5a3fc3f03ebebeb7ab41a3a986fa98..6f5069d75049cca7f996162d7716d614b3ba0de4 100644 (file)
@@ -8,12 +8,12 @@ public sealed partial class AmeFuelContainerComponent : Component
     /// <summary>
     /// The amount of fuel in the container.
     /// </summary>
-    [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
+    [DataField, AutoNetworkedField]
     public int FuelAmount = 500;
 
     /// <summary>
     /// The maximum fuel capacity of the container.
     /// </summary>
-    [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
+    [DataField, AutoNetworkedField]
     public int FuelCapacity = 500;
 }