Fix mechanism events not being called properly, add test (#2279)
* Add mechanism events when added/removed to/from body/parts * Change old usages * Add TODO * Remove BodyExtensions and IHasBody * Remove unnecessary extensions and fix wrong event call in mechanism behavior component * Complete test and fix event calls
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
{
|
||||
base.Appearance = value;
|
||||
|
||||
if (Owner.TryGetBody(out var body))
|
||||
if (Owner.TryGetComponent(out IBody body))
|
||||
{
|
||||
foreach (var part in body.Parts.Values)
|
||||
{
|
||||
@@ -35,7 +35,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
{
|
||||
base.Startup();
|
||||
|
||||
if (Appearance != null && Owner.TryGetBody(out var body))
|
||||
if (Appearance != null && Owner.TryGetComponent(out IBody body))
|
||||
{
|
||||
foreach (var part in body.Parts.Values)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user