chore: Fixes variable types for possible performance issues (#2172)

This commit is contained in:
Kamron Batman 2025-05-01 21:54:41 -07:00 • committed by GitHub
parent 6d43f2549c
commit da517f56c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
82 changed files with 332 additions and 343 deletions

View file

@ -2334,9 +2334,7 @@ namespace Server.Multis
}
else
{
Container c = fromState.AddTrade(toState);
c.DropItem(new TransferItem(this));
fromState.AddTrade(toState).DropItem(new TransferItem(this));
}
}
}
@ -3357,9 +3355,7 @@ namespace Server.Multis
{
for (var i = 0; i < Doors.Count; ++i)
{
Item item = Doors[i];
item?.Delete();
Doors[i]?.Delete();
}
Doors.Clear();

View file

@ -72,19 +72,18 @@ namespace Server.Multis
{
if (item is PackingBox packingBox)
{
Container box = packingBox;
var subItems = box.Items;
var subItems = packingBox.Items;
if (subItems.Count < MaxItemsPerSubcontainer)
{
box.DropItem(dropped);
packingBox.DropItem(dropped);
return;
}
}
}
// 3. Drop the item into a new container
Container subContainer = new PackingBox();
var subContainer = new PackingBox();
subContainer.DropItem(dropped);
var location = GetFreeLocation();