Fix storage fastpath logical oversight (#37852)

This commit is contained in:
Nemanja
2025-08-05 17:11:01 +02:00
committed by Quanteey
parent ade1c74484
commit 717e14ba1d
@@ -1330,7 +1330,7 @@ public abstract class SharedStorageSystem : EntitySystem
// This uses a faster path than the typical codepaths
// as we can cache a bunch more data and re-use it to avoid a bunch of component overhead.
// So if we have an item that occupies 0,0 we can assume that the tile itself we're checking
// So if we have an item that occupies 0,0 and is a single rectangle we can assume that the tile itself we're checking
// is always in its shapes regardless of angle. This matches virtually every item in the game and
// means we can skip getting the item's rotated shape at all if the tile is occupied.
// This mostly makes heavy checks (e.g. area insert) much, much faster.
@@ -1338,14 +1338,8 @@ public abstract class SharedStorageSystem : EntitySystem
var itemShape = ItemSystem.GetItemShape(itemEnt);
var fastAngles = itemShape.Count == 1;
foreach (var shape in itemShape)
{
if (shape.Contains(Vector2i.Zero))
{
fastPath = true;
break;
}
}
if (itemShape.Count == 1 && itemShape[0].Contains(Vector2i.Zero))
fastPath = true;
var chunkEnumerator = new ChunkIndicesEnumerator(storageBounding, StorageComponent.ChunkSize);
var angles = new ValueList<Angle>();