Release 1.9.7.0 - Summer Update 2025
This commit is contained in:
@@ -438,9 +438,14 @@ namespace Barotrauma.Items.Components
|
||||
ActiveContainedItem activeContainedItem = new(containedItem, effect, containableItem.ExcludeBroken, containableItem.ExcludeFullCondition, containableItem.BlameEquipperForDeath);
|
||||
activeContainedItems.Add(activeContainedItem);
|
||||
|
||||
if (!ShouldApplyEffects(activeContainedItem)) { continue; }
|
||||
if (!ShouldApplyEffects(activeContainedItem) || item.Submarine is { Loading: true} || initializingLoadedItems ||
|
||||
containedItem.OnInsertedEffectsApplied)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
activeContainedItem.StatusEffect.Apply(ActionType.OnInserted, deltaTime: 1, item, targets);
|
||||
}
|
||||
containedItem.OnInsertedEffectsApplied = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -511,6 +516,8 @@ namespace Barotrauma.Items.Components
|
||||
activeContainedItem.StatusEffect.Apply(ActionType.OnRemoved, deltaTime: 1, item, targets);
|
||||
}
|
||||
|
||||
containedItem.OnInsertedEffectsApplied = false;
|
||||
|
||||
activeContainedItems.RemoveAll(i => i.Item == containedItem);
|
||||
containedItems.RemoveAll(i => i.Item == containedItem);
|
||||
item.SetContainedItemPositions();
|
||||
@@ -680,7 +687,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
foreach (ActiveContainedItem activeContainedItem in activeContainedItems)
|
||||
{
|
||||
if (!ShouldApplyEffects(activeContainedItem)) continue;
|
||||
if (!ShouldApplyEffects(activeContainedItem)) { continue; }
|
||||
|
||||
StatusEffect effect = activeContainedItem.StatusEffect;
|
||||
effect.Apply(ActionType.OnActive, deltaTime, item, targets);
|
||||
@@ -993,6 +1000,8 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
//flip if flipped on one axis but not both (flipping on both axes is basically "double negative" and makes the rotation normal again)
|
||||
if (flippedX ^ flippedY) { rotation = -rotation; }
|
||||
rotation += -item.RotationRad;
|
||||
}
|
||||
contained.Item.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, rotation);
|
||||
@@ -1050,8 +1059,17 @@ namespace Barotrauma.Items.Components
|
||||
transformedItemIntervalHorizontal = new Vector2(transformedItemInterval.X, 0.0f);
|
||||
transformedItemIntervalVertical = new Vector2(0.0f, transformedItemInterval.Y);
|
||||
|
||||
flippedX = item.RootContainer?.FlippedX ?? (item.FlippedX && item.Prefab.CanSpriteFlipX);
|
||||
flippedY = item.RootContainer?.FlippedY ?? (item.FlippedY && item.Prefab.CanSpriteFlipY);
|
||||
if (item.RootContainer != null)
|
||||
{
|
||||
flippedX = item.RootContainer.FlippedX && item.RootContainer.Prefab.CanSpriteFlipX;
|
||||
flippedY = item.RootContainer.FlippedY && item.RootContainer.Prefab.CanSpriteFlipY;
|
||||
}
|
||||
else
|
||||
{
|
||||
flippedX = item.FlippedX && item.Prefab.CanSpriteFlipX;
|
||||
flippedY = item.FlippedY && item.Prefab.CanSpriteFlipY;
|
||||
}
|
||||
|
||||
var rootBody = item.RootContainer?.body ?? item.body;
|
||||
bool bodyFlipped = rootBody is { Dir: -1 };
|
||||
|
||||
@@ -1123,10 +1141,13 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
private bool initializingLoadedItems;
|
||||
|
||||
public override void OnMapLoaded()
|
||||
{
|
||||
if (itemIds != null)
|
||||
{
|
||||
initializingLoadedItems = true;
|
||||
for (ushort i = 0; i < itemIds.Length; i++)
|
||||
{
|
||||
if (i >= Inventory.Capacity)
|
||||
@@ -1138,10 +1159,11 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
foreach (ushort id in itemIds[i])
|
||||
{
|
||||
if (!(Entity.FindEntityByID(id) is Item item)) { continue; }
|
||||
if (Entity.FindEntityByID(id) is not Item item) { continue; }
|
||||
Inventory.TryPutItem(item, i, false, false, null, createNetworkEvent: false, ignoreCondition: true);
|
||||
}
|
||||
}
|
||||
initializingLoadedItems = false;
|
||||
itemIds = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user