chore: Fixes variable types for possible performance issues (#2172)
This commit is contained in:
parent
6d43f2549c
commit
da517f56c4
82 changed files with 332 additions and 343 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue