-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DLC Quest Bug Fix more item then location non existing start inventory #4735
base: main
Are you sure you want to change the base?
Conversation
Start inventory item that do not exist in the present world do not make more trap item to appear anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this currently works properly if a player adds items to start inventory such that there is more of an item in start inventory than there is of that item in created_items
, when there is at least 1 of that item in created_items
.
I have given two suggestions that I think would fix the issue.
worlds/dlcquest/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I think the better design would be to rework item creation to not create excluded items in the first place, rather than removing excluded items after the item pool has been created. Then the count of created items, used to determine how many trap items to add, will be correct from the start and won't have to be adjusted for how many items are going to be removed from the item pool later on at the end of create_items()
.
Alternatively, only add the trap items after all the excluded items have been removed from the item pool.
The former is better because
for item in items_to_exclude:
if item in self.multiworld.itempool:
self.multiworld.itempool.remove(item)
is not great due to the fact that is has to search the entire multiworld's item pool (twice) for each item.
The effect of this could be minimised to the point where it matters much less, by removing the excluded items from created_items
before the items in created_items
are added to the multiworld's item pool.
Though I would still recommend not creating items in the first place that you don't actually want to add to the multiworld's item pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented your idea thanks for it
Co-authored-by: Mysteryem <Mysteryem@users.noreply.github.com>
did the recommendation of Mysteryem and made the item not exist in the pool of item created
What is this fixing or adding?
fix: Start inventory item would make a miss number of item from the number of location under certain condition
https://discord.com/channels/731205301247803413/1349141593692704829
How was this tested?
Test where run and the world that failed to have the same number of location and item now work properly, other worlds with different item were tested