File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -89,17 +89,17 @@ def create_items(self):
89
89
pool .append (self .create_item ("Puzzle Skip" ))
90
90
91
91
if traps :
92
- trap_weights = {name : self .options .trap_weights .get (name , 0 ) for name in TRAP_ITEMS }
93
- total_weight = sum (trap_weights .values ())
92
+ total_weight = sum (self .options .trap_weights .values ())
94
93
95
94
if total_weight == 0 :
96
95
raise Exception ("Sum of trap weights must be at least one." )
97
96
98
- trap_counts = {name : int (weight * traps / total_weight ) for name , weight in trap_weights .items ()}
97
+ trap_counts = {name : int (weight * traps / total_weight )
98
+ for name , weight in self .options .trap_weights .items ()}
99
99
100
100
trap_difference = traps - sum (trap_counts .values ())
101
101
if trap_difference > 0 :
102
- allowed_traps = [name for name in TRAP_ITEMS if trap_weights [name ] > 0 ]
102
+ allowed_traps = [name for name in TRAP_ITEMS if self . options . trap_weights [name ] > 0 ]
103
103
for i in range (0 , trap_difference ):
104
104
trap_counts [allowed_traps [i % len (allowed_traps )]] += 1
105
105
You can’t perform that action at this time.
0 commit comments