Implement some field-level deltas (#28242)
* Update GasTileOverlayState * Update DecalGridState * Update NavMapState * poke * poke2 * poke3 * Implement field deltas for guns * Content done * Update --------- Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
@@ -57,7 +57,7 @@ public abstract partial class SharedGunSystem
|
||||
Audio.PlayPredicted(component.SoundInsert, uid, args.User);
|
||||
args.Handled = true;
|
||||
UpdateBallisticAppearance(uid, component);
|
||||
Dirty(uid, component);
|
||||
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
|
||||
}
|
||||
|
||||
private void OnBallisticAfterInteract(EntityUid uid, BallisticAmmoProviderComponent component, AfterInteractEvent args)
|
||||
@@ -194,10 +194,9 @@ public abstract partial class SharedGunSystem
|
||||
!Paused(uid))
|
||||
{
|
||||
gunComp.NextFire = Timing.CurTime + TimeSpan.FromSeconds(1 / gunComp.FireRateModified);
|
||||
Dirty(uid, gunComp);
|
||||
DirtyField(uid, gunComp, nameof(GunComponent.NextFire));
|
||||
}
|
||||
|
||||
Dirty(uid, component);
|
||||
Audio.PlayPredicted(component.SoundRack, uid, user);
|
||||
|
||||
var shots = GetBallisticShots(component);
|
||||
@@ -228,7 +227,7 @@ public abstract partial class SharedGunSystem
|
||||
{
|
||||
component.UnspawnedCount = Math.Max(0, component.Capacity - component.Container.ContainedEntities.Count);
|
||||
UpdateBallisticAppearance(uid, component);
|
||||
Dirty(uid, component);
|
||||
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.UnspawnedCount));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,18 +248,19 @@ public abstract partial class SharedGunSystem
|
||||
|
||||
args.Ammo.Add((entity, EnsureShootable(entity)));
|
||||
component.Entities.RemoveAt(component.Entities.Count - 1);
|
||||
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
|
||||
Containers.Remove(entity, component.Container);
|
||||
}
|
||||
else if (component.UnspawnedCount > 0)
|
||||
{
|
||||
component.UnspawnedCount--;
|
||||
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.UnspawnedCount));
|
||||
entity = Spawn(component.Proto, args.Coordinates);
|
||||
args.Ammo.Add((entity, EnsureShootable(entity)));
|
||||
}
|
||||
}
|
||||
|
||||
UpdateBallisticAppearance(uid, component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
private void OnBallisticAmmoCount(EntityUid uid, BallisticAmmoProviderComponent component, ref GetAmmoCountEvent args)
|
||||
|
||||
Reference in New Issue
Block a user