forked from sass/tipibot
Fix fishing sell bug
This commit is contained in:
@@ -928,7 +928,8 @@ async def do_fish_sell(user_id: int, indices: list[int] | None = None) -> dict:
|
||||
to_sell = inv
|
||||
remaining = []
|
||||
else:
|
||||
to_sell = [inv[i] for i in sorted(set(indices)) if 0 <= i < len(inv)]
|
||||
valid_indices = [i if i >= 0 else len(inv) + i for i in indices]
|
||||
to_sell = [inv[i] for i in sorted(set(valid_indices)) if 0 <= i < len(inv)]
|
||||
keep_idx = set(range(len(inv))) - set(indices)
|
||||
remaining = [inv[i] for i in sorted(keep_idx)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user