Code Cleanup & Fixes Warnings (#74)
This commit is contained in:
parent
e11d1f3ad9
commit
57b14ad690
143 changed files with 2960 additions and 3427 deletions
|
|
@ -550,19 +550,21 @@ namespace Server.Engines.ConPVP
|
|||
else if (m_Path.Count > 0)
|
||||
MoveToWorld(m_Path.Last);
|
||||
|
||||
int myZ = Map.GetAverageZ(X, Y);
|
||||
int myZ = Map?.GetAverageZ(X, Y) ?? 0;
|
||||
|
||||
StaticTile[] statics = Map.Tiles.GetStaticTiles(X, Y, true);
|
||||
for (int j = 0; j < statics.Length; j++)
|
||||
{
|
||||
StaticTile t = statics[j];
|
||||
StaticTile[] statics = Map?.Tiles?.GetStaticTiles(X, Y, true);
|
||||
|
||||
ItemData id = TileData.ItemTable[t.ID & TileData.MaxItemValue];
|
||||
height = id.CalcHeight;
|
||||
if (statics != null)
|
||||
for (int j = 0; j < statics.Length; j++)
|
||||
{
|
||||
StaticTile t = statics[j];
|
||||
|
||||
if (t.Z + height > myZ && t.Z + height <= Z)
|
||||
myZ = t.Z + height;
|
||||
}
|
||||
ItemData id = TileData.ItemTable[t.ID & TileData.MaxItemValue];
|
||||
height = id.CalcHeight;
|
||||
|
||||
if (t.Z + height > myZ && t.Z + height <= Z)
|
||||
myZ = t.Z + height;
|
||||
}
|
||||
|
||||
IPooledEnumerable<Item> eable = GetItemsInRange(0);
|
||||
foreach (Item item in eable)
|
||||
|
|
@ -1428,8 +1430,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_Bomb != null && Controller != null)
|
||||
{
|
||||
if (m_UnhideCallback == null)
|
||||
m_UnhideCallback = UnhideBomb;
|
||||
m_UnhideCallback ??= UnhideBomb;
|
||||
m_Bomb.Visible = false;
|
||||
m_Bomb.MoveToWorld(Controller.BombHome, Controller.Map);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 15)), m_UnhideCallback);
|
||||
|
|
@ -1504,7 +1505,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private void DelayBounce_Callback(Mobile mob, Container corpse)
|
||||
{
|
||||
DuelPlayer dp = mob is PlayerMobile mobile ? mobile.DuelPlayer : null;
|
||||
DuelPlayer dp = (mob as PlayerMobile)?.DuelPlayer;
|
||||
|
||||
m_Context.RemoveAggressions(mob);
|
||||
|
||||
|
|
@ -1722,7 +1723,9 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
for (int i = 0; i < m_Context.Participants.Count; ++i)
|
||||
{
|
||||
if (!(m_Context.Participants[i] is Participant p) || p.Players == null)
|
||||
Participant p = m_Context.Participants[i];
|
||||
|
||||
if (p?.Players == null)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < p.Players.Length; ++j)
|
||||
|
|
@ -1736,7 +1739,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
if (i == winner.TeamID)
|
||||
if (i == winner?.TeamID)
|
||||
continue;
|
||||
|
||||
if (p.Players != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue