From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Sun, 30 Nov 2025 13:58:39 +0000 (-0800) Subject: Make Firespread logical (#41636) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=3d32dab66116e5bab547f4b571a4c11da4503fb5;p=space-station-14.git Make Firespread logical (#41636) * FIRE * code comment fix --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 071c63c500..f630e4e610 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -225,20 +225,14 @@ namespace Content.Server.Atmos.EntitySystems mass2 = otherPhys.Mass; } - // when the thing on fire is more massive than the other, the following happens: - // - the thing on fire loses a small number of firestacks - // - the other thing gains a large number of firestacks - // so a person on fire engulfs a mouse, but an engulfed mouse barely does anything to a person - var total = mass1 + mass2; - var avg = (flammable.FireStacks + otherFlammable.FireStacks) / total; - - // swap the entity losing stacks depending on whichever has the most firestack kilos - var (src, dest) = flammable.FireStacks * mass1 > otherFlammable.FireStacks * mass2 - ? (-1f, 1f) - : (1f, -1f); - // bring each entity to the same firestack mass, firestacks being scaled by the other's mass - AdjustFireStacks(uid, src * avg * mass2, flammable, ignite: true); - AdjustFireStacks(otherUid, dest * avg * mass1, otherFlammable, ignite: true); + // Get the average of both entity's firestacks * mass + // Then for each entity, we divide the average by their mass and set their firestacks to that value + // An entity with a higher mass will lose some fire and transfer it to the one with lower mass. + var avg = (flammable.FireStacks * mass1 + otherFlammable.FireStacks * mass2) / 2f; + + // bring each entity to the same firestack mass, firestack amount is scaled by the inverse of the entity's mass + SetFireStacks(uid, avg / mass1, flammable, ignite: true); + SetFireStacks(otherUid, avg / mass2, otherFlammable, ignite: true); } private void OnIsHot(EntityUid uid, FlammableComponent flammable, IsHotEvent args)