Prevent fly-by fixture from powering containment field generator (#29225)
* Prevent fly-by fixture from powering containment field generator * Update according to review
This commit is contained in:
committed by
GitHub
parent
67cc089dd0
commit
2b92ec79f7
@@ -65,7 +65,8 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem
|
||||
/// </summary>
|
||||
private void HandleGeneratorCollide(Entity<ContainmentFieldGeneratorComponent> generator, ref StartCollideEvent args)
|
||||
{
|
||||
if (_tags.HasTag(args.OtherEntity, generator.Comp.IDTag))
|
||||
if (args.OtherFixtureId == generator.Comp.SourceFixtureId &&
|
||||
_tags.HasTag(args.OtherEntity, generator.Comp.IDTag))
|
||||
{
|
||||
ReceivePower(generator.Comp.PowerReceived, generator);
|
||||
generator.Comp.Accumulator = 0f;
|
||||
|
||||
@@ -69,6 +69,13 @@ public sealed partial class ContainmentFieldGeneratorComponent : Component
|
||||
[DataField("idTag", customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>))]
|
||||
public string IDTag = "EmitterBolt";
|
||||
|
||||
/// <summary>
|
||||
/// Which fixture ID should test collision with from the entity that powers the generator?
|
||||
/// Prevents the generator from being powered by fly-by fixtures.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string SourceFixtureId = "projectile";
|
||||
|
||||
/// <summary>
|
||||
/// Is the generator toggled on?
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user