@@ -232,26 +232,26 @@ private static bool BuildingIsOnLevel(BuildingEnum building, int lvl, Village vi
232
232
/// </summary>
233
233
/// <param name="vill"></param>
234
234
/// <returns>Whether there were some tasks removed</returns>
235
- public static bool RemoveFinishedCB ( Village vill )
236
- {
237
- var tasksDone = vill . Build
238
- . CurrentlyBuilding
239
- . Where ( x => x . Duration < DateTime . Now )
240
- . ToList ( ) ;
241
-
242
- if ( tasksDone . Count == 0 ) return false ;
243
-
244
- foreach ( var taskDone in tasksDone )
245
- {
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 ;
249
-
250
- if ( building . Level < taskDone . Level ) building . Level = taskDone . Level ;
251
- vill . Build . CurrentlyBuilding . Remove ( taskDone ) ;
252
- }
253
- return true ;
254
- }
235
+ // public static bool RemoveFinishedCB(Village vill)
236
+ // {
237
+ // var tasksDone = vill.Build
238
+ // .CurrentlyBuilding
239
+ // .Where(x => x.Duration < DateTime.Now)
240
+ // .ToList();
241
+
242
+ // if (tasksDone.Count == 0) return false;
243
+
244
+ // foreach (var taskDone in tasksDone)
245
+ // {
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;
249
+
250
+ // if (building.Level < taskDone.Level) building.Level = taskDone.Level;
251
+ // vill.Build.CurrentlyBuilding.Remove(taskDone);
252
+ // }
253
+ // return true;
254
+ // }
255
255
256
256
/// <summary>
257
257
/// Used by building task to get the url for navigation
@@ -294,11 +294,11 @@ public static bool IsTaskCompleted(Village vill, Account acc, BuildingTask task)
294
294
if ( task . Level <= building . Level ) return true ;
295
295
296
296
// If the building is being upgraded to the desired level, task is complete
297
- var cb = vill . Build
298
- . CurrentlyBuilding
299
- . OrderByDescending ( x => x . Level )
300
- . FirstOrDefault ( x => x . Location == task . BuildingId ) ;
301
- if ( cb != null && task . Level <= cb . Level ) return true ;
297
+ // var cb = vill.Build
298
+ // .CurrentlyBuilding
299
+ // .OrderByDescending(x => x.Level)
300
+ // .FirstOrDefault(x => x.Location == task.BuildingId);
301
+ // if (cb != null && task.Level <= cb.Level) return true;
302
302
break ;
303
303
304
304
case BuildingType . AutoUpgradeResFields :
@@ -442,7 +442,7 @@ internal static bool UpgradeBuildingForOneLvl(Account acc, Village vill, Buildin
442
442
443
443
var currentLvl = ( int ) upgrade . Level ;
444
444
445
- RemoveFinishedCB ( vill ) ;
445
+ // RemoveFinishedCB(vill);
446
446
currentLvl += vill . Build . CurrentlyBuilding . Count ( x => x . Building == building ) ;
447
447
448
448
if ( BuildingsData . MaxBuildingLevel ( acc , building ) == currentLvl )
@@ -479,7 +479,7 @@ internal static bool UpgradeBuildingForOneLvl(Account acc, Village vill, Buildin
479
479
/// <returns>Whether we have all prerequisite buildings</returns>
480
480
public static bool AddBuildingPrerequisites ( Account acc , Village vill , BuildingEnum building , bool bottom = true )
481
481
{
482
- RemoveFinishedCB ( vill ) ;
482
+ // RemoveFinishedCB(vill);
483
483
484
484
( var tribe , var prereqs ) = BuildingsData . GetBuildingPrerequisites ( building ) ;
485
485
if ( acc . AccInfo . Tribe != tribe && tribe != TribeEnum . Any ) return false ;
0 commit comments