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:
@@ -114,15 +114,6 @@ namespace Content.Shared.GameObjects.Components.Body.Part
|
||||
mechanism.Part = this;
|
||||
SizeUsed += mechanism.Size;
|
||||
|
||||
if (Body == null)
|
||||
{
|
||||
mechanism.AddedToPart();
|
||||
}
|
||||
else
|
||||
{
|
||||
mechanism.AddedToPartInBody();
|
||||
}
|
||||
|
||||
Dirty();
|
||||
}
|
||||
|
||||
@@ -132,15 +123,6 @@ namespace Content.Shared.GameObjects.Components.Body.Part
|
||||
mechanism.Part = null;
|
||||
SizeUsed -= mechanism.Size;
|
||||
|
||||
if (Body == null)
|
||||
{
|
||||
mechanism.RemovedFromPart(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
mechanism.RemovedFromPartInBody(Body, this);
|
||||
}
|
||||
|
||||
Dirty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user