Fix inventory transform bug (#21144)
This commit is contained in:
@@ -27,6 +27,7 @@ public abstract partial class InventorySystem
|
|||||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
[Dependency] private readonly INetManager _netMan = default!;
|
[Dependency] private readonly INetManager _netMan = default!;
|
||||||
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||||
|
|
||||||
private void InitializeEquip()
|
private void InitializeEquip()
|
||||||
{
|
{
|
||||||
@@ -372,20 +373,10 @@ public abstract partial class InventorySystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force)
|
if (!slotContainer.Remove(removedItem.Value, force: force))
|
||||||
{
|
return false;
|
||||||
slotContainer.ForceRemove(removedItem.Value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!slotContainer.Remove(removedItem.Value))
|
|
||||||
{
|
|
||||||
//should never happen bc of the canremove lets just keep in just in case
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Transform(removedItem.Value).Coordinates = Transform(target).Coordinates;
|
_transform.DropNextTo(removedItem.Value, target);
|
||||||
|
|
||||||
if (!silent && Resolve(removedItem.Value, ref clothing, false) && clothing.UnequipSound != null && _gameTiming.IsFirstTimePredicted)
|
if (!silent && Resolve(removedItem.Value, ref clothing, false) && clothing.UnequipSound != null && _gameTiming.IsFirstTimePredicted)
|
||||||
{
|
{
|
||||||
@@ -405,8 +396,7 @@ public abstract partial class InventorySystem
|
|||||||
SoundSystem.Play(clothing.UnequipSound.GetSound(), filter, target, clothing.UnequipSound.Params.WithVolume(-2f));
|
SoundSystem.Play(clothing.UnequipSound.GetSound(), filter, target, clothing.UnequipSound.Params.WithVolume(-2f));
|
||||||
}
|
}
|
||||||
|
|
||||||
inventory.Dirty();
|
Dirty(target, inventory);
|
||||||
|
|
||||||
_movementSpeed.RefreshMovementSpeedModifiers(target);
|
_movementSpeed.RefreshMovementSpeedModifiers(target);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user