Fixed Welding Tool Not Updating (#1314)

* Fix Welding Tool Not Updating

- Added in the ISolutionChange interface so that it dirties the entity any time the amount of welding fuel changes. This applies whether it's lit or unlit.
- I also removed some redundant code.

* Update Content.Server/GameObjects/Components/Interactable/WelderComponent.cs

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
bhespiritu
2020-07-08 05:46:54 -04:00
committed by GitHub
parent 4721fd2035
commit df395b9435

View File

@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Interactable
[RegisterComponent]
[ComponentReference(typeof(ToolComponent))]
[ComponentReference(typeof(IToolComponent))]
public class WelderComponent : ToolComponent, IExamine, IUse, ISuicideAct
public class WelderComponent : ToolComponent, IExamine, IUse, ISuicideAct, ISolutionChange
{
#pragma warning disable 649
[Dependency] private IEntitySystemManager _entitySystemManager;
@@ -193,7 +193,6 @@ namespace Content.Server.GameObjects.Components.Interactable
if (Fuel == 0)
ToggleWelderStatus();
Dirty();
}
public SuicideKind Suicide(IEntity victim, IChatManager chat)
@@ -207,5 +206,10 @@ namespace Content.Server.GameObjects.Components.Interactable
chat.EntityMe(victim, Loc.GetString("bashes {0:themselves} with the {1}!", victim, Owner.Name));
return SuicideKind.Brute;
}
public void SolutionChanged(SolutionChangeEventArgs eventArgs)
{
Dirty();
}
}
}