Skip to content

Commit

Permalink
Fixed scrubber filter setting (SerbiaStrong-220#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
DexlerXD authored May 12, 2024
1 parent 9ce3e7b commit c31238d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ public sealed partial class GasVentScrubberComponent : Component
[DataField("outlet")]
public string OutletName { get; set; } = "pipe";

//SS220-scrubber-mode begin
[ViewVariables(VVAccess.ReadOnly)]
public HashSet<Gas> FilterGases = new(GasVentScrubberData.DefaultFilterGases);
[ViewVariables]
public readonly HashSet<Gas> FilterGases = new(GasVentScrubberData.DefaultFilterGases);

//SS220-scrubber-mode begin
/// <summary>
/// Filter mode, which will be set on a scrubber on a map initialization (or spawn).
/// </summary>
[DataField("initialFilter"), ViewVariables]
public GasVentScrubberData.ScrubberFilter InitialFilter { get; set; } = GasVentScrubberData.ScrubberFilter.Default;
//SS220-scrubber-mode end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public override void Initialize()
private void OnInit(Entity<GasVentScrubberComponent> entity, ref MapInitEvent args)
{
var scrubberMode = GasVentScrubberData.ScrubberFilters[entity.Comp.InitialFilter];
entity.Comp.FilterGases = scrubberMode;

var filterGases = entity.Comp.FilterGases;
filterGases.Clear();
foreach (var gas in scrubberMode)
filterGases.Add(gas);
}
//SS220-scrubber-mode end

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/SS220/Entities/Structures/unary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
parent: GasVentScrubber
id: GasVentScrubberBasa
suffix: WideFiltering
name: Скруббер
name: скруббер
description: Он же вытяжка. Имеет клапан и прикрепленный к нему насос.
components:
- type: GasVentScrubber
Expand Down

0 comments on commit c31238d

Please sign in to comment.