Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -73,7 +73,7 @@ namespace Server.Mobiles
if (pack == null)
return;
ArrayList list = new ArrayList();
List<Item> list = new List<Item>();
foreach (Item item in GetItemsInRange(2))
if (item.Movable && item.Stackable)
@ -83,17 +83,14 @@ namespace Server.Mobiles
for (int i = 0; i < list.Count; ++i)
{
Item item = (Item)list[i];
Item item = list[i];
if (!pack.CheckHold(this, item, false, true))
return;
bool rejected;
LRReason reject;
NextActionTime = Core.TickCount;
Lift(item, item.Amount, out rejected, out reject);
Lift(item, item.Amount, out bool rejected, out LRReason _);
if (rejected)
continue;
@ -105,7 +102,7 @@ namespace Server.Mobiles
}
}
private void ConfirmRelease_Callback(Mobile from, bool okay, object state)
private void ConfirmRelease_Callback(Mobile from, bool okay)
{
if (okay)
EndRelease(from);
@ -113,10 +110,8 @@ namespace Server.Mobiles
public override void BeginRelease(Mobile from)
{
Container pack = Backpack;
if (pack != null && pack.Items.Count > 0)
from.SendGump(new WarningGump(1060635, 30720, 1061672, 32512, 420, 280, ConfirmRelease_Callback, null));
if (Backpack?.Items.Count > 0)
from.SendGump(new WarningGump(1060635, 30720, 1061672, 32512, 420, 280, okay => ConfirmRelease_Callback(from, okay)));
else
EndRelease(from);
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Mobiles
{
@ -69,7 +70,7 @@ namespace Server.Mobiles
if (caster == null)
return;
ArrayList list = new ArrayList();
List<Mobile> list = new List<Mobile>();
foreach (Mobile m in GetMobilesInRange(5))
if (m.Player && m.Alive && !m.IsDeadBondedPet && m.Karma <= 0 && m.AccessLevel < AccessLevel.Counselor)
@ -77,7 +78,7 @@ namespace Server.Mobiles
for (int i = 0; i < list.Count; ++i)
{
Mobile m = (Mobile)list[i];
Mobile m = list[i];
bool friendly = true;
for (int j = 0; friendly && j < caster.Aggressors.Count; ++j)