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; } }
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; } }