Predict AME Fuel Examine (#38018)

* init

* :)
This commit is contained in:
ScarKy0
2025-06-03 13:51:50 +02:00
committed by GitHub
parent 06476d766d
commit 9dd0855dd0
2 changed files with 7 additions and 2 deletions

View 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));

View 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;
}