示例#1
0
        public void disableFrendlyFire(UnitDamagedEvent e)
        {
            //Log.Warning(e.damageMeta.Instigator.ToString());
            //Log.Warning(e.damageMeta.Source.ToString());

            if (e.damageMeta.Instigator == null)
            {
                return;
            }

            Pawn source = e.damageMeta.Instigator as Pawn;

            if (source == null)
            {
                return;
            }

            if (source.MindState.Sanity != Verse.AI.SanityState.Normal)
            {
                return;
            }

            if (e.pawn.Faction == source.Faction)
            {
                //Log.Warning("Disabled frendly fire event");
                e.suppressed = true;
            }
        }
示例#2
0
        public void disableFrendlyFire(UnitDamagedEvent e)
        {
            //Log.Warning(e.damageMeta.Instigator.ToString());
            //Log.Warning(e.damageMeta.Source.ToString());

            if (e.damageMeta.Instigator == null)
                return;

            Pawn source = e.damageMeta.Instigator as Pawn;

            if (source == null)
                return;

            if (source.MindState.Sanity != Verse.AI.SanityState.Normal)
                return;

            if (e.pawn.Faction == source.Faction)
            {
                //Log.Warning("Disabled frendly fire event");
                e.suppressed = true;
            }
        }