We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c68930f commit 12a3b42Copy full SHA for 12a3b42
TbsCore/Helpers/BuildingHelper.cs
@@ -243,8 +243,9 @@ public static bool RemoveFinishedCB(Village vill)
243
244
foreach (var taskDone in tasksDone)
245
{
246
- var building = vill.Build.Buildings.First(x => x.Id == taskDone.Location);
247
- if (building.Type != taskDone.Building) continue;
+ var building = vill.Build.Buildings.FirstOrDefault(x => x.Id == taskDone.Location);
+ if (building == null) building = vill.Build.Buildings.FirstOrDefault(x => x.Type == taskDone.Building);
248
+ if (building == null || building.Type != taskDone.Building) continue;
249
250
if (building.Level < taskDone.Level) building.Level = taskDone.Level;
251
vill.Build.CurrentlyBuilding.Remove(taskDone);
0 commit comments