コード例 #1
0
ファイル: DamageBeing.cs プロジェクト: sknchan/LegacyRust
    public bool IsDifferentPlayer(PlayerClient exclude)
    {
        if (!this.id)
        {
            return(false);
        }
        IDMain dMain = this.idOwnerMain;

        if (!dMain)
        {
            dMain = this.id.idMain;
            if (!dMain)
            {
                return(false);
            }
        }
        if (dMain is Character)
        {
            PlayerClient playerClient = ((Character)dMain).playerClient;
            return(!playerClient ? false : playerClient != exclude);
        }
        if (dMain is IDeployedObjectMain)
        {
            DeployedObjectInfo deployedObjectInfo = ((IDeployedObjectMain)dMain).DeployedObjectInfo;
            if (deployedObjectInfo.valid)
            {
                PlayerClient playerClient1 = deployedObjectInfo.playerClient;
                return(!playerClient1 ? false : playerClient1 != exclude);
            }
        }
        Controllable component = dMain.GetComponent <Controllable>();

        if (!component)
        {
            return(false);
        }
        PlayerClient playerClient2 = component.playerClient;

        return(!playerClient2 ? false : playerClient2 != exclude);
    }
コード例 #2
0
ファイル: DamageBeing.cs プロジェクト: salvadj1/RustSource
 public bool IsDifferentPlayer(PlayerClient exclude)
 {
     if (this.id != null)
     {
         IDMain idOwnerMain = this.idOwnerMain;
         if (idOwnerMain == null)
         {
             idOwnerMain = this.id.idMain;
             if (idOwnerMain == null)
             {
                 return(false);
             }
         }
         if (idOwnerMain is Character)
         {
             PlayerClient playerClient = ((Character)idOwnerMain).playerClient;
             return((playerClient != null) && (playerClient != exclude));
         }
         if (idOwnerMain is IDeployedObjectMain)
         {
             DeployedObjectInfo deployedObjectInfo = ((IDeployedObjectMain)idOwnerMain).DeployedObjectInfo;
             if (deployedObjectInfo.valid)
             {
                 PlayerClient client2 = deployedObjectInfo.playerClient;
                 return((client2 != null) && (client2 != exclude));
             }
         }
         Controllable component = idOwnerMain.GetComponent <Controllable>();
         if (component != null)
         {
             PlayerClient client3 = component.playerClient;
             return((client3 != null) && (client3 != exclude));
         }
     }
     return(false);
 }