Fix BodySystem and Gibbing (#20460)
* Fix gibbing & body system Makes it so that bodies no longer have two sets of torso organs and that gibbed bodies get spread around on the floor again. * Actually fix the double torso problem * rootSlot in cameFrom * Remove SetCoordinates inside GibBody() * Don't use entity.RandomOffset() in GibBody() * Gibbing now uses _random.NextVector2()
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Body.Prototypes;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Organ;
|
||||
@@ -156,6 +156,7 @@ public partial class SharedBodySystem
|
||||
|
||||
// Child -> Parent connection.
|
||||
var cameFrom = new Dictionary<string, string>();
|
||||
cameFrom[rootSlot] = rootSlot;
|
||||
// Maps slot to its relevant entity.
|
||||
var cameFromEntities = new Dictionary<string, EntityUid>();
|
||||
cameFromEntities[rootSlot] = rootPartId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Standing;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -50,7 +50,7 @@ public abstract partial class SharedBodySystem : EntitySystem
|
||||
// This is blursed
|
||||
var slotIndex = containerSlotId.IndexOf(PartSlotContainerIdPrefix, StringComparison.Ordinal);
|
||||
|
||||
if (slotIndex < -1)
|
||||
if (slotIndex < 0)
|
||||
return null;
|
||||
|
||||
var slotId = containerSlotId.Remove(slotIndex, PartSlotContainerIdPrefix.Length);
|
||||
|
||||
Reference in New Issue
Block a user