From c1d0851ec35c410733da53b919541b8fab491407 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Thu, 7 Jun 2018 11:41:30 +0200 Subject: fixed Dice and Soundplayback errors --- DiscoBot/DSA_Game/Characters/Character.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'DiscoBot/DSA_Game/Characters') diff --git a/DiscoBot/DSA_Game/Characters/Character.cs b/DiscoBot/DSA_Game/Characters/Character.cs index d92fc63..5c39fc5 100644 --- a/DiscoBot/DSA_Game/Characters/Character.cs +++ b/DiscoBot/DSA_Game/Characters/Character.cs @@ -118,7 +118,12 @@ var attack = this.Kampftalente.OrderBy(x => sc.Compare(talent, x.Name)).First(); if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold) { - SoundEffects.Play(Sound.Wrong); + try + { + SoundEffects.Play(Sound.Wrong); + } + catch { } + return $"{this.Name} kann nicht mit der Waffenart {talent} umgehen..."; } @@ -142,7 +147,11 @@ if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold) { - SoundEffects.Play(Sound.Wrong); + try + { + SoundEffects.Play(Sound.Wrong); + } + catch { } return $"{this.Name} kann nicht mit der Waffenart {talent} umgehen..."; } @@ -166,7 +175,11 @@ var attack = this.Talente.OrderBy(x => sc.Compare(talent, x.Name)).First(); if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold) { - SoundEffects.Play(Sound.Wrong); + try + { + SoundEffects.Play(Sound.Wrong); + } + catch { } return $"{this.Name} kann nicht mit der Waffenart {talent} umgehen..."; } -- cgit v1.2.3-70-g09d2