@@ -20,54 +20,21 @@ public static void Postfix(ref CraftingCampaignBehavior __instance, Hero hero, E
2020 TLSmithingFasterOperationCounts . Flag = true ;
2121 int maxcounts = TLSmithingFasterOperationCounts . GetMaxCounts ( ref __instance , hero , equipmentElement ) ;
2222 maxcounts = Math . Min ( maxcounts , 4 ) ;
23- IEnumerable < EquipmentElement > locks = Campaign . Current . GetCampaignBehavior < InventoryLockTracker > ( ) . GetLocks ( ) ;
24- ItemRoster itemRoster = MobileParty . MainParty . ItemRoster ;
25- ItemRosterElement [ ] ItemRosterElements = itemRoster . GetCopyOfAllElements ( ) ;
26- bool IsLocked = false ;
27- int max_item_count = ItemRosterElements . Length ;
28- for ( int i = 0 ; i < max_item_count && maxcounts > 0 ; i ++ )
23+ for ( int i = 0 ; i < maxcounts ; i ++ )
2924 {
30- itemRoster = MobileParty . MainParty . ItemRoster ;
31- ItemRosterElements = itemRoster . GetCopyOfAllElements ( ) ;
32- foreach ( EquipmentElement EquipmentElement in locks )
33- {
34- if ( EquipmentElement . IsEqualTo ( ItemRosterElements [ i ] . EquipmentElement ) )
35- {
36- IsLocked = true ;
37- break ;
38- }
39- }
40- int item_num = ItemRosterElements [ i ] . Amount ;
41- int j ;
42- for ( j = 0 ; j < item_num && ! IsLocked && ItemRosterElements [ i ] . EquipmentElement . Item . IsCraftedWeapon ; j ++ )
43- {
44- __instance . DoSmelting ( hero , ItemRosterElements [ i ] . EquipmentElement ) ;
45- maxcounts -- ;
46- if ( maxcounts <= 0 )
47- {
48- TLSmithingFasterOperationCounts . Flag = false ;
49- return ;
50- }
51- }
52- if ( j == item_num )
53- {
54- i -- ;
55- max_item_count -- ;
56- }
57- IsLocked = false ;
25+ __instance . DoSmelting ( hero , equipmentElement ) ;
5826 }
5927 TLSmithingFasterOperationCounts . Flag = false ;
6028 }
6129 if ( topScreen != null && Input . IsKeyDown ( InputKey . LeftControl ) && ! TLSmithingFasterOperationCounts . Flag )
6230 {
6331 TLSmithingFasterOperationCounts . Flag = true ;
64- int maxcounts = TLSmithingFasterOperationCounts . GetMaxCounts ( ref __instance , hero , equipmentElement ) ;
6532 IEnumerable < EquipmentElement > locks = Campaign . Current . GetCampaignBehavior < InventoryLockTracker > ( ) . GetLocks ( ) ;
6633 ItemRoster itemRoster = MobileParty . MainParty . ItemRoster ;
6734 ItemRosterElement [ ] ItemRosterElements = itemRoster . GetCopyOfAllElements ( ) ;
6835 bool IsLocked = false ;
6936 int max_item_count = ItemRosterElements . Length ;
70- for ( int i = 0 ; i < max_item_count && maxcounts > 0 ; i ++ )
37+ for ( int i = 0 ; i < max_item_count ; i ++ )
7138 {
7239 itemRoster = MobileParty . MainParty . ItemRoster ;
7340 ItemRosterElements = itemRoster . GetCopyOfAllElements ( ) ;
@@ -83,13 +50,13 @@ public static void Postfix(ref CraftingCampaignBehavior __instance, Hero hero, E
8350 int j ;
8451 for ( j = 0 ; j < item_num && ! IsLocked && ItemRosterElements [ i ] . EquipmentElement . Item . IsCraftedWeapon ; j ++ )
8552 {
86- __instance . DoSmelting ( hero , ItemRosterElements [ i ] . EquipmentElement ) ;
87- maxcounts -- ;
53+ int maxcounts = TLSmithingFasterOperationCounts . GetMaxCounts ( ref __instance , hero , ItemRosterElements [ i ] . EquipmentElement ) ;
8854 if ( maxcounts <= 0 )
8955 {
9056 TLSmithingFasterOperationCounts . Flag = false ;
9157 return ;
9258 }
59+ __instance . DoSmelting ( hero , ItemRosterElements [ i ] . EquipmentElement ) ;
9360 }
9461 if ( j == item_num )
9562 {
0 commit comments