Use null propagation

This commit is contained in:
Gustas
2023-02-19 15:29:08 +02:00
committed by Pavel Penev
parent b06cbd7a95
commit 157d1b32dc
12 changed files with 30 additions and 36 deletions

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits
{
if (!world.IsLoadingGameSave)
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer?.Faction.InternalName);
TextNotificationsManager.AddTransientLine(info.TextNotification, null);
}
}
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
{
if (!world.IsReplay)
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.LoadedNotification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.LoadedNotification, world.RenderPlayer?.Faction.InternalName);
TextNotificationsManager.AddTransientLine(info.LoadedTextNotification, null);
}
}
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
{
if (!world.IsReplay)
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.SavedNotification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.SavedNotification, world.RenderPlayer?.Faction.InternalName);
TextNotificationsManager.AddTransientLine(info.SavedTextNotification, null);
}
}