ToolSystem UseTool doesn't log missing components, slight cleanup for things using tools.
This commit is contained in:
@@ -41,7 +41,6 @@ namespace Content.Server.Power.Components
|
||||
if (_cableDroppedOnCutPrototype == null)
|
||||
return false;
|
||||
|
||||
if (!eventArgs.Using.TryGetComponent<ToolComponent>(out var tool)) return false;
|
||||
if (!await EntitySystem.Get<ToolSystem>().UseTool(eventArgs.Using.Uid, eventArgs.User.Uid, Owner.Uid, 0f, 0.25f, _cuttingQuality)) return false;
|
||||
|
||||
Owner.Delete();
|
||||
|
||||
@@ -399,12 +399,6 @@ namespace Content.Server.Storage.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!eventArgs.Using.TryGetComponent(out WelderComponent? tool) || !tool.Lit)
|
||||
{
|
||||
_beingWelded = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_beingWelded)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Content.Server.Tools.Components
|
||||
if (!tileDef.CanCrowbar)
|
||||
return;
|
||||
|
||||
if (_toolComponentNeeded && !await EntitySystem.Get<ToolSystem>().UseTool(Owner.Uid, user.Uid, null, 0f, 0f, _qualityNeeded))
|
||||
if (_toolComponentNeeded && !await EntitySystem.Get<ToolSystem>().UseTool(Owner.Uid, user.Uid, null, 0f, 0f, _qualityNeeded, toolComponent:tool))
|
||||
return;
|
||||
|
||||
coordinates.PryTile(Owner.EntityManager, _mapManager);
|
||||
|
||||
@@ -39,7 +39,8 @@ namespace Content.Server.Tools
|
||||
float doAfterDelay, IEnumerable<string> toolQualitiesNeeded, Func<bool>? doAfterCheck = null,
|
||||
ToolComponent? toolComponent = null)
|
||||
{
|
||||
if (!Resolve(tool, ref toolComponent))
|
||||
// No logging here, after all that'd mean the caller would need to check if the component is there or not.
|
||||
if (!Resolve(tool, ref toolComponent, false))
|
||||
return false;
|
||||
|
||||
if (!toolComponent.Qualities.ContainsAll(toolQualitiesNeeded) || !_actionBlockerSystem.CanInteract(user))
|
||||
|
||||
Reference in New Issue
Block a user