SlowContactsSystem to SpeedModifierContactsSystem mini rework (#26110)

* rework

* update logic
This commit is contained in:
Ed
2024-03-17 05:27:22 +03:00
committed by GitHub
parent 209846b18a
commit c35ff87e14
9 changed files with 42 additions and 34 deletions

View File

@@ -45,9 +45,9 @@ namespace Content.Server.Chemistry.TileReactions
var step = entityManager.EnsureComponent<StepTriggerComponent>(puddleUid);
entityManager.EntitySysManager.GetEntitySystem<StepTriggerSystem>().SetRequiredTriggerSpeed(puddleUid, _requiredSlipSpeed, step);
var slow = entityManager.EnsureComponent<SlowContactsComponent>(puddleUid);
var slow = entityManager.EnsureComponent<SpeedModifierContactsComponent>(puddleUid);
var speedModifier = 1 - reagent.Viscosity;
entityManager.EntitySysManager.GetEntitySystem<SlowContactsSystem>().ChangeModifiers(puddleUid, speedModifier, slow);
entityManager.EntitySysManager.GetEntitySystem<SpeedModifierContactsSystem>().ChangeModifiers(puddleUid, speedModifier, slow);
return reactVolume;
}

View File

@@ -54,7 +54,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
[Dependency] private readonly SharedPopupSystem _popups = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly StepTriggerSystem _stepTrigger = default!;
[Dependency] private readonly SlowContactsSystem _slowContacts = default!;
[Dependency] private readonly SpeedModifierContactsSystem _speedModContacts = default!;
[Dependency] private readonly TileFrictionController _tile = default!;
[ValidatePrototypeId<ReagentPrototype>]
@@ -435,13 +435,13 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
if (maxViscosity > 0)
{
var comp = EnsureComp<SlowContactsComponent>(uid);
var comp = EnsureComp<SpeedModifierContactsComponent>(uid);
var speed = 1 - maxViscosity;
_slowContacts.ChangeModifiers(uid, speed, comp);
_speedModContacts.ChangeModifiers(uid, speed, comp);
}
else
{
RemComp<SlowContactsComponent>(uid);
RemComp<SpeedModifierContactsComponent>(uid);
}
}