private static void ProcessPlayers(FlashbangGrenade grenade, List <Player> players) { foreach (Player player in players) { if (HitboxIdentity.CheckFriendlyFire(grenade.PreviousOwner.Role, player.ReferenceHub.characterClassManager.CurClass)) { grenade.ProcessPlayer(player.ReferenceHub); } } }
private static bool PlayExplosionEffects(FlashbangGrenade __instance) { try { float time = __instance._blindingOverDistance.keys[__instance._blindingOverDistance.length - 1].time; float num = time * time; foreach (KeyValuePair <GameObject, ReferenceHub> keyValuePair in ReferenceHub.GetAllHubs()) { if (!(keyValuePair.Value == null) && (__instance.transform.position - keyValuePair.Value.transform.position).sqrMagnitude <= num && !(keyValuePair.Value == __instance.PreviousOwner.Hub) && HitboxIdentity.CheckFriendlyFire(__instance.PreviousOwner.Hub, keyValuePair.Value, false)) { __instance.ProcessPlayer(keyValuePair.Value); } } return(false); } catch (Exception ex) { Logger.Get.Error($"Synapse-FF: PlayExplosionFlash failed!!\n{ex}"); return(true); } }