Fix Reagent Fire Stacks (#30766)

* Fix Reagent Fire Stacks

* Comments on code

* little nicer wording?
This commit is contained in:
Cojoke
2024-08-12 09:48:39 -05:00
committed by GitHub
parent d4c0155d66
commit 0c1cfe8f18

View File

@@ -13,8 +13,9 @@ namespace Content.Server.EntityEffects.Effects
[DataField]
public float Multiplier = 0.05f;
// The fire stack multiplier if fire stacks already exist on target, only works if 0 or greater
[DataField]
public float MultiplierOnExisting = 1f;
public float MultiplierOnExisting = -1f;
public override bool ShouldLog => true;
@@ -28,7 +29,8 @@ namespace Content.Server.EntityEffects.Effects
if (!args.EntityManager.TryGetComponent(args.TargetEntity, out FlammableComponent? flammable))
return;
var multiplier = flammable.FireStacks == 0f ? Multiplier : MultiplierOnExisting;
// Sets the multiplier for FireStacks to MultiplierOnExisting is 0 or greater and target already has FireStacks
var multiplier = flammable.FireStacks != 0f && MultiplierOnExisting >= 0 ? MultiplierOnExisting : Multiplier;
var quantity = 1f;
if (args is EntityEffectReagentArgs reagentArgs)
{