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:
DrSmugleaf
2020-10-17 12:26:39 +02:00
committed by GitHub
parent 05a78f117d
commit 101fa9e466
25 changed files with 365 additions and 154 deletions

View File

@@ -68,7 +68,7 @@ namespace Content.Server.GameObjects.Components.Body
_callbackCache = null;
// Attempt surgery on a body by sending a list of operable parts for the client to choose from
if (eventArgs.Target.TryGetBody(out var body))
if (eventArgs.Target.TryGetComponent(out IBody? body))
{
// Create dictionary to send to client (text to be shown : data sent back if selected)
var toSend = new Dictionary<string, int>();