Use Null-Propagation Operator

This commit is contained in:
teinarss
2020-08-16 11:38:14 +02:00
committed by Paul Chote
parent 8d27d22100
commit 9c4fd0e3d3
113 changed files with 219 additions and 464 deletions

View File

@@ -326,17 +326,13 @@ namespace OpenRA.Platforms.Default
public void StopSound(ISound sound)
{
if (sound == null)
return;
((OpenAlSound)sound).Stop();
((OpenAlSound)sound)?.Stop();
}
public void StopAllSounds()
{
foreach (var slot in sourcePool.Values)
if (slot.Sound != null)
slot.Sound.Stop();
slot.Sound?.Stop();
}
public void SetListenerPosition(WPos position)