Fixes sequential checks
This commit is contained in:
parent
83dcf536d8
commit
42d0b6271f
67 changed files with 99 additions and 99 deletions
|
|
@ -59,7 +59,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( m_Bomb.Parent == null && m_Bomb.m_Game != null && m_Bomb.m_Game.Controller != null )
|
||||
if ( m_Bomb.Parent == null && m_Bomb.m_Game?.Controller != null )
|
||||
{
|
||||
if ( !m_Bomb.m_Flying && m_Bomb.Map != Map.Internal )
|
||||
Effects.SendLocationEffect( m_Bomb.GetWorldLocation(), m_Bomb.Map, 0x377A, 16, 10, m_Bomb.Hue, 0 );
|
||||
|
|
@ -483,7 +483,7 @@ namespace Server.Engines.ConPVP
|
|||
int height;
|
||||
bool found = false;
|
||||
|
||||
if ( m_PathIdx < m_Path.Count && Map != null && Map.Tiles != null && Map != Map.Internal )
|
||||
if ( m_PathIdx < m_Path.Count && Map?.Tiles != null && Map != Map.Internal )
|
||||
{
|
||||
int pathCheckEnd = m_PathIdx + 5;
|
||||
|
||||
|
|
@ -927,7 +927,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( !Visible )
|
||||
return true;
|
||||
|
||||
if ( m == null || !m.Player || !m.Alive || m.Backpack == null || m_Team == null || m_Team.Game == null )
|
||||
if ( m == null || !m.Player || !m.Alive || m.Backpack == null || m_Team?.Game == null )
|
||||
return true;
|
||||
|
||||
if ( !base.OnMoveOver( m ) )
|
||||
|
|
@ -960,7 +960,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_TeamInfo != null && m_TeamInfo.Game != null )
|
||||
if ( m_TeamInfo?.Game != null )
|
||||
{
|
||||
from.CloseGump( typeof( BRBoardGump ) );
|
||||
from.SendGump( new BRBoardGump( from, m_TeamInfo.Game ) );
|
||||
|
|
@ -1522,7 +1522,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
public override bool CantDoAnything( Mobile mob )
|
||||
{
|
||||
if ( mob == null || mob.Backpack == null || GetTeamInfo( mob ) == null )
|
||||
if ( mob?.Backpack == null || GetTeamInfo( mob ) == null )
|
||||
return false;
|
||||
|
||||
Item bomb = mob.Backpack.FindItemByType( typeof( BRBomb ), true );
|
||||
|
|
@ -1880,7 +1880,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
DuelPlayer dp = p.Players[j];
|
||||
|
||||
if ( dp != null && dp.Mobile != null )
|
||||
if ( dp?.Mobile != null )
|
||||
{
|
||||
dp.Mobile.CloseGump( typeof( BRBoardGump ) );
|
||||
dp.Mobile.SendGump( new BRBoardGump( dp.Mobile, this ) );
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_TeamInfo != null && m_TeamInfo.Game != null )
|
||||
if ( m_TeamInfo?.Game != null )
|
||||
{
|
||||
from.CloseGump( typeof( CTFBoardGump ) );
|
||||
from.SendGump( new CTFBoardGump( from, m_TeamInfo.Game ) );
|
||||
|
|
@ -105,7 +105,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
CTFTeamInfo teamInfo = game.Controller.TeamInfo[i % 8];
|
||||
|
||||
if ( teamInfo == null || teamInfo.Flag == null )
|
||||
if ( teamInfo?.Flag == null )
|
||||
continue;
|
||||
|
||||
entries.Add( teamInfo );
|
||||
|
|
@ -250,7 +250,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_TeamInfo != null && m_TeamInfo.Game != null )
|
||||
if ( m_TeamInfo?.Game != null )
|
||||
{
|
||||
CTFTeamInfo ourTeam = m_TeamInfo;
|
||||
CTFTeamInfo useTeam = m_TeamInfo.Game.GetTeamInfo( from );
|
||||
|
|
@ -380,7 +380,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
SendHome();
|
||||
|
||||
if ( m_TeamInfo != null && m_TeamInfo.Game != null )
|
||||
if ( m_TeamInfo?.Game != null )
|
||||
m_TeamInfo.Game.Alert( "The {0} cookies have been returned.", m_TeamInfo.Name );
|
||||
|
||||
return;
|
||||
|
|
@ -1125,7 +1125,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
CTFTeamInfo teamInfo = m_Controller.TeamInfo[i % 8];
|
||||
|
||||
if ( teamInfo == null || teamInfo.Flag == null )
|
||||
if ( teamInfo?.Flag == null )
|
||||
continue;
|
||||
|
||||
teams.Add( teamInfo );
|
||||
|
|
@ -1262,7 +1262,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
DuelPlayer dp = p.Players[j];
|
||||
|
||||
if ( dp != null && dp.Mobile != null )
|
||||
if ( dp?.Mobile != null )
|
||||
{
|
||||
dp.Mobile.CloseGump( typeof( CTFBoardGump ) );
|
||||
dp.Mobile.SendGump( new CTFBoardGump( dp.Mobile, this ) );
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_TeamInfo != null && m_TeamInfo.Game != null )
|
||||
if ( m_TeamInfo?.Game != null )
|
||||
{
|
||||
from.CloseGump( typeof( DDBoardGump ) );
|
||||
from.SendGump( new DDBoardGump( from, m_TeamInfo.Game ) );
|
||||
|
|
@ -971,9 +971,9 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
DDTeamInfo team = null;
|
||||
|
||||
if ( m_Controller.PointA != null && m_Controller.PointA.TeamOwner != null )
|
||||
if ( m_Controller.PointA?.TeamOwner != null )
|
||||
team = m_Controller.PointA.TeamOwner;
|
||||
else if ( m_Controller.PointB != null && m_Controller.PointB.TeamOwner != null )
|
||||
else if ( m_Controller.PointB?.TeamOwner != null )
|
||||
team = m_Controller.PointB.TeamOwner;
|
||||
|
||||
if ( team == null )
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
get
|
||||
{
|
||||
if (m_Player == null || m_Player.Name == null)
|
||||
if (m_Player?.Name == null)
|
||||
return "";
|
||||
return m_Player.Name;
|
||||
}
|
||||
|
|
@ -960,7 +960,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
get
|
||||
{
|
||||
if (m_Context != null && m_Context.Arena != null)
|
||||
if (m_Context?.Arena != null)
|
||||
return m_Context.Arena.Facet;
|
||||
|
||||
return m_Controller.Map;
|
||||
|
|
|
|||
|
|
@ -2227,7 +2227,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public void Alert( Arena arena, params string[] alerts )
|
||||
{
|
||||
if ( arena != null && arena.Announcer != null )
|
||||
if ( arena?.Announcer != null )
|
||||
{
|
||||
for ( int j = 0; j < alerts.Length; ++j )
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( Math.Max( j-0.5, 0.0 ) ), new TimerStateCallback( Alert_Callback ), new object[]{ arena.Announcer, alerts[j] } );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue