Fix bot traits crashing on missing ResourceMapBotModule

This commit is contained in:
Gustas
2025-10-14 14:26:16 +03:00
committed by Gustas Kažukauskas
parent 4cd1b4e208
commit 08d07eeb06
3 changed files with 3 additions and 3 deletions

View File

@@ -257,7 +257,7 @@ namespace OpenRA.Mods.Common.Traits
{
if (firstTick)
{
ResourceMapModule = bot.Player.PlayerActor.TraitsImplementing<ResourceMapBotModule>().First(t => t.IsTraitEnabled());
ResourceMapModule = bot.Player.PlayerActor.TraitsImplementing<ResourceMapBotModule>().FirstOrDefault(t => t.IsTraitEnabled());
firstTick = false;
}