Inventory slot enumerator rejig (#21788)
This commit is contained in:
@@ -42,26 +42,26 @@ public sealed class MagnetPickupSystem : EntitySystem
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
var query = EntityQueryEnumerator<MagnetPickupComponent, StorageComponent, TransformComponent>();
|
||||
var query = EntityQueryEnumerator<MagnetPickupComponent, StorageComponent, TransformComponent, MetaDataComponent>();
|
||||
var currentTime = _timing.CurTime;
|
||||
|
||||
while (query.MoveNext(out var uid, out var comp, out var storage, out var xform))
|
||||
while (query.MoveNext(out var uid, out var comp, out var storage, out var xform, out var meta))
|
||||
{
|
||||
if (comp.NextScan > currentTime)
|
||||
continue;
|
||||
|
||||
comp.NextScan += ScanDelay;
|
||||
|
||||
// No space
|
||||
if (!_storage.HasSpace((uid, storage)))
|
||||
continue;
|
||||
|
||||
if (!_inventory.TryGetContainingSlot(uid, out var slotDef))
|
||||
if (!_inventory.TryGetContainingSlot((uid, xform, meta), out var slotDef))
|
||||
continue;
|
||||
|
||||
if ((slotDef.SlotFlags & comp.SlotFlags) == 0x0)
|
||||
continue;
|
||||
|
||||
// No space
|
||||
if (!_storage.HasSpace((uid, storage)))
|
||||
continue;
|
||||
|
||||
var parentUid = xform.ParentUid;
|
||||
var playedSound = false;
|
||||
var finalCoords = xform.Coordinates;
|
||||
|
||||
Reference in New Issue
Block a user