Reduce action blocker uses and add target entity to CanInteract (#6655)

This commit is contained in:
Leon Friedrich
2022-02-15 17:06:52 +13:00
committed by GitHub
parent 334568dad2
commit ad9ddf1552
60 changed files with 286 additions and 402 deletions

View File

@@ -102,9 +102,6 @@ namespace Content.Server.Tools
return false;
}
if (user != null && !_actionBlockerSystem.CanInteract(user.Value))
return false;
solution.RemoveReagent(welder.FuelReagent, welder.FuelLitCost);
welder.Lit = true;
@@ -140,9 +137,6 @@ namespace Content.Server.Tools
// Optional components.
Resolve(uid, ref item, ref light, ref sprite);
if (user != null && !_actionBlockerSystem.CanInteract(user.Value))
return false;
welder.Lit = false;
// TODO: Make all this use visualizers.

View File

@@ -23,7 +23,6 @@ namespace Content.Server.Tools
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
@@ -214,7 +213,7 @@ namespace Content.Server.Tools
if (!Resolve(tool, ref toolComponent))
return false;
if (!toolComponent.Qualities.ContainsAll(toolQualitiesNeeded) || !_actionBlockerSystem.CanInteract(user))
if (!toolComponent.Qualities.ContainsAll(toolQualitiesNeeded))
return false;
var beforeAttempt = new ToolUseAttemptEvent(fuel, user);