merge stable into master (#37856)
This commit is contained in:
@@ -1326,7 +1326,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
// This uses a faster path than the typical codepaths
|
// 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.
|
// 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
|
// 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.
|
// 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.
|
// This mostly makes heavy checks (e.g. area insert) much, much faster.
|
||||||
@@ -1334,14 +1334,8 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
var itemShape = ItemSystem.GetItemShape(itemEnt);
|
var itemShape = ItemSystem.GetItemShape(itemEnt);
|
||||||
var fastAngles = itemShape.Count == 1;
|
var fastAngles = itemShape.Count == 1;
|
||||||
|
|
||||||
foreach (var shape in itemShape)
|
if (itemShape.Count == 1 && itemShape[0].Contains(Vector2i.Zero))
|
||||||
{
|
fastPath = true;
|
||||||
if (shape.Contains(Vector2i.Zero))
|
|
||||||
{
|
|
||||||
fastPath = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var chunkEnumerator = new ChunkIndicesEnumerator(storageBounding, StorageComponent.ChunkSize);
|
var chunkEnumerator = new ChunkIndicesEnumerator(storageBounding, StorageComponent.ChunkSize);
|
||||||
var angles = new ValueList<Angle>();
|
var angles = new ValueList<Angle>();
|
||||||
|
|||||||
Reference in New Issue
Block a user