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:
@@ -15,6 +15,7 @@ public sealed partial class GunSystem
|
||||
{
|
||||
var existing = component.Entities[^1];
|
||||
component.Entities.RemoveAt(component.Entities.Count - 1);
|
||||
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.Entities));
|
||||
|
||||
Containers.Remove(existing, component.Container);
|
||||
EnsureShootable(existing);
|
||||
@@ -22,6 +23,7 @@ public sealed partial class GunSystem
|
||||
else if (component.UnspawnedCount > 0)
|
||||
{
|
||||
component.UnspawnedCount--;
|
||||
DirtyField(uid, component, nameof(BallisticAmmoProviderComponent.UnspawnedCount));
|
||||
ent = Spawn(component.Proto, coordinates);
|
||||
EnsureShootable(ent.Value);
|
||||
}
|
||||
|
||||
@@ -39,8 +39,9 @@ public sealed partial class GunSystem
|
||||
if (solution == null && !_solutionContainer.TryGetSolution(uid, component.SolutionId, out _, out solution))
|
||||
{
|
||||
component.Shots = shots;
|
||||
DirtyField(uid, component, nameof(SolutionAmmoProviderComponent.Shots));
|
||||
component.MaxShots = maxShots;
|
||||
Dirty(uid, component);
|
||||
DirtyField(uid, component, nameof(SolutionAmmoProviderComponent.MaxShots));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,8 +49,10 @@ public sealed partial class GunSystem
|
||||
maxShots = (int) (solution.MaxVolume / component.FireCost);
|
||||
|
||||
component.Shots = shots;
|
||||
DirtyField(uid, component, nameof(SolutionAmmoProviderComponent.Shots));
|
||||
|
||||
component.MaxShots = maxShots;
|
||||
Dirty(uid, component);
|
||||
DirtyField(uid, component, nameof(SolutionAmmoProviderComponent.MaxShots));
|
||||
|
||||
UpdateSolutionAppearance(uid, component);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user