Skip to content

Commit 12a3b42

Browse files
committed
TTWars ww fix
1 parent c68930f commit 12a3b42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

TbsCore/Helpers/BuildingHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ public static bool RemoveFinishedCB(Village vill)
243243

244244
foreach (var taskDone in tasksDone)
245245
{
246-
var building = vill.Build.Buildings.First(x => x.Id == taskDone.Location);
247-
if (building.Type != taskDone.Building) continue;
246+
var building = vill.Build.Buildings.FirstOrDefault(x => x.Id == taskDone.Location);
247+
if (building == null) building = vill.Build.Buildings.FirstOrDefault(x => x.Type == taskDone.Building);
248+
if (building == null || building.Type != taskDone.Building) continue;
248249

249250
if (building.Level < taskDone.Level) building.Level = taskDone.Level;
250251
vill.Build.CurrentlyBuilding.Remove(taskDone);

0 commit comments

Comments
 (0)