Code cleanup (#188)
This commit is contained in:
parent
df53c16620
commit
010fd9402a
185 changed files with 1052 additions and 1271 deletions
|
|
@ -1188,7 +1188,7 @@ namespace Server.Mobiles
|
|||
if (IsParagon)
|
||||
IsParagon = false;
|
||||
|
||||
Timer.DelayCall(TimeSpan.Zero, CheckMorph);
|
||||
Timer.DelayCall(CheckMorph);
|
||||
}
|
||||
|
||||
public override void AddCustomContextEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ namespace Server.Mobiles
|
|||
}
|
||||
|
||||
if (version < 1)
|
||||
Timer.DelayCall(TimeSpan.Zero, UpgradeFromVersion0);
|
||||
Timer.DelayCall(UpgradeFromVersion0);
|
||||
}
|
||||
|
||||
private void UpgradeFromVersion0()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.BulkOrders;
|
||||
using Server.Ethics;
|
||||
|
|
@ -326,16 +327,10 @@ namespace Server.Mobiles
|
|||
{
|
||||
if (BaseHouse.NewVendorSystem) return ChargePerRealWorldDay / 12;
|
||||
|
||||
long total = 0;
|
||||
foreach (VendorItem vi in m_SellItems.Values)
|
||||
total += vi.Price;
|
||||
long total = m_SellItems.Values.Aggregate<VendorItem, long>(0, (current, vi) =>
|
||||
current + vi.Price) - 500;
|
||||
|
||||
total -= 500;
|
||||
|
||||
if (total < 0)
|
||||
total = 0;
|
||||
|
||||
return (int)(20 + total / 500);
|
||||
return (int)(20 + Math.Max(total, 0) / 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -345,9 +340,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
if (BaseHouse.NewVendorSystem)
|
||||
{
|
||||
long total = 0;
|
||||
foreach (VendorItem vi in m_SellItems.Values)
|
||||
total += vi.Price;
|
||||
long total = m_SellItems.Values.Aggregate<VendorItem, long>(0, (current, vi) => current + vi.Price);
|
||||
|
||||
return (int)(60 + total / 500 * 3);
|
||||
}
|
||||
|
|
@ -438,11 +431,11 @@ namespace Server.Mobiles
|
|||
if (version < 1)
|
||||
{
|
||||
m_ShopName = "Shop Not Yet Named";
|
||||
Timer.DelayCall(TimeSpan.Zero, UpgradeFromVersion0, newVendorSystemActivated);
|
||||
Timer.DelayCall(UpgradeFromVersion0, newVendorSystemActivated);
|
||||
}
|
||||
else
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.Zero, FixDresswear);
|
||||
Timer.DelayCall(FixDresswear);
|
||||
}
|
||||
|
||||
NextPayTime = DateTime.UtcNow + PayTimer.GetInterval();
|
||||
|
|
@ -829,7 +822,7 @@ namespace Server.Mobiles
|
|||
if (IsOwner(from))
|
||||
{
|
||||
if (GetVendorItem(item) == null)
|
||||
Timer.DelayCall(TimeSpan.Zero, () => OnItemGiven(from, item));
|
||||
Timer.DelayCall(OnItemGiven, from, item);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1521,7 +1514,7 @@ namespace Server.Mobiles
|
|||
|
||||
Vendor = (PlayerVendor)reader.ReadMobile();
|
||||
|
||||
Timer.DelayCall(TimeSpan.Zero, Delete);
|
||||
Timer.DelayCall(Delete);
|
||||
}
|
||||
|
||||
private class ExpireTimer : Timer
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Server.Mobiles
|
|||
|
||||
if (Items.Count == 0 && Gold == 0)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.Zero, Delete);
|
||||
Timer.DelayCall(Delete);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue