@@ -124,7 +124,7 @@ public static void DebugGiveAllUpgrades(this PlayerState self)
124124 /// <summary>Fills the player's inventory with random items</summary>
125125 /// <param name="self">The Ammo instance</param>
126126 /// <param name="fillTo"></param>
127- public static void DebugFillRandomAmmo ( this Ammo self , int fillTo )
127+ public static void DebugFillRandomAmmo ( this Ammo self )
128128 {
129129 var potentialAmmo = GetPrivateField < Ammo , GameObject [ ] > ( "potentialAmmo" , self ) ;
130130 var numSlots = GetPrivateField < Ammo , int > ( "numSlots" , self ) ;
@@ -135,6 +135,8 @@ public static void DebugFillRandomAmmo(this Ammo self, int fillTo)
135135
136136 for ( var i = 0 ; i < numSlots ; i ++ )
137137 {
138+ int fillTo = self . GetSlotMaxCount ( i ) ;
139+
138140 // pick a random item to insert into the slot
139141 var plucked = Randoms . SHARED . Pluck ( new List < GameObject > ( potentialAmmo ) , null ) ;
140142
@@ -160,7 +162,7 @@ public static void DebugFillRandomAmmo(this Ammo self, int fillTo)
160162 /// <summary>Refills the player's inventory</summary>
161163 /// <param name="self">The Ammo instance</param>
162164 /// <param name="fillTo"></param>
163- public static void DebugRefillAmmo ( this Ammo self , int fillTo )
165+ public static void DebugRefillAmmo ( this Ammo self )
164166 {
165167 var ammoSlot = typeof ( Ammo ) . GetNestedType ( "Slot" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
166168 var slotCount = ammoSlot . GetField ( "count" ) ;
@@ -169,6 +171,8 @@ public static void DebugRefillAmmo(this Ammo self, int fillTo)
169171
170172 for ( var i = 0 ; i < numSlots ; i ++ )
171173 {
174+ int fillTo = self . GetSlotMaxCount ( i ) ;
175+
172176 if ( slots [ i ] != null )
173177 slotCount ? . SetValue ( slots [ i ] , fillTo ) ;
174178 else if ( i == numSlots - 1 ) // refill water if slot empty
0 commit comments