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