Cleanup construction component

This commit is contained in:
zumorica
2020-04-29 15:34:49 +02:00
parent 995ed64789
commit 659d623784

View File

@@ -144,46 +144,10 @@ namespace Content.Server.GameObjects.Components.Construction
case ConstructionStepTool toolStep: case ConstructionStepTool toolStep:
if (!slapped.TryGetComponent<ToolComponent>(out var tool)) if (!slapped.TryGetComponent<ToolComponent>(out var tool))
return false; return false;
switch (toolStep.Tool) if (toolStep.Tool != tool.Behavior) return false;
{ tool.PlayUseSound();
case Tool.Crowbar: return true;
if (tool.Behavior == Tool.Crowbar)
{
tool.PlayUseSound();
return true;
}
return false;
case Tool.Welder:
if (tool.Behavior == Tool.Welder && tool.TryWeld(toolStep.Amount))
{
tool.PlayUseSound();
return true;
}
return false;
case Tool.Wrench:
if (tool.Behavior == Tool.Wrench)
{
tool.PlayUseSound();
return true;
}
return false;
case Tool.Screwdriver:
if (tool.Behavior == Tool.Screwdriver)
{
tool.PlayUseSound();
return true;
}
return false;
case Tool.Wirecutter:
if (tool.Behavior == Tool.Wirecutter)
{
tool.PlayUseSound();
return true;
}
return false;
default:
throw new NotImplementedException();
}
default: default:
throw new NotImplementedException(); throw new NotImplementedException();
} }