Refactor body component to use slots instead of an army of dictionaries (#3749)
* Refactor body component to use slots instead of an army of dictionaries * Update vox * Replace static method call with extension * Add setpart method, replace dispose with shutdown * Fix tests, fix not listening to slot events when setting a part
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
|
||||
if (Owner.TryGetComponent(out IBody? body))
|
||||
{
|
||||
foreach (var part in body.Parts.Values)
|
||||
foreach (var (part, _) in body.Parts)
|
||||
{
|
||||
if (!part.Owner.TryGetComponent(out SpriteComponent? sprite))
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
|
||||
if (Appearance != null! && Owner.TryGetComponent(out IBody? body))
|
||||
{
|
||||
foreach (var part in body.Parts.Values)
|
||||
foreach (var (part, _) in body.Parts)
|
||||
{
|
||||
if (!part.Owner.TryGetComponent(out SpriteComponent? sprite))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user