public static void Postfix(SoundDef soundDef, SoundInfo info) { TargetInfo maker = info.Maker; if (maker != null) { StackTrace st = new StackTrace(); maker.Map.GetComponent <MapComp_Noise>().AddBang(maker.Cell, NoiseUtility.GetSoundLevel(soundDef)); } }
public static void Postfix(SoundDef soundDef, SoundInfo info, Sustainer __result) { TargetInfo maker = info.Maker; if (maker != null && soundDef.sustain) { int level = (int)NoiseUtility.GetSoundLevel(soundDef); Pawn actor = null; if (!KeepQuietSettings.selfAnnoy && maker.Thing != null && maker.Thing is Pawn pawn && pawn.RaceProps.Humanlike) { actor = pawn; } maker.Map.GetComponent <MapComp_Noise>().AddPolluter(__result, maker.Cell, level, actor); } }