Пример #1
0
        private bool IsValidKill(PlayerSession victim, PlayerSession killer)
        {
            if (sameStake)
            {
                var stakes = Resources.FindObjectsOfTypeAll <OwnershipStakeServer>();
                foreach (OwnershipStakeServer stake in stakes)
                {
                    if (stake.AuthorizedPlayers.Contains(victim.Identity) && stake.AuthorizedPlayers.Contains(killer.Identity))
                    {
                        return(false);
                    }
                }
            }

            if (sameClan)
            {
                Clan victim_clan = victim.Identity.Clan;
                Clan killer_clan = killer.Identity.Clan;

                if (victim_clan != null && killer_clan != null)
                {
                    if (victim_clan.Equals(killer_clan))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }