Skip to content
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

added check for parent in insertion menu (no more bagception) #46913

Merged
merged 2 commits into from
Jan 24, 2021

Conversation

Jamuro-g
Copy link
Contributor

@Jamuro-g Jamuro-g commented Jan 20, 2021

Summary

SUMMARY: Bugfixes "added a check for parent items in the insertion menu"

Purpose of change

A check that compares the holsters parent to the item is added to prevent storing the bag that contains the bag that is trying to store the bag ... bagception prevented

Fixes #46904

Describe the solution

The items in the insert ui are compared to the holsters parent to prevent players from trying to store a bag inside itself via a proxi bag.

Describe alternatives you've considered

Leaving it in and creating a black hole spell effect that instantly murders the player and everything on the screen?

Testing

Spawn 2 bagpacks
Wear backpack 1
Insert backpack 2 in it
Open the insert menu for backpack 2 (not inside backpack 1) and look for backpack 1

@anothersimulacrum anothersimulacrum added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things labels Jan 20, 2021
@moxian
Copy link
Contributor

moxian commented Jan 21, 2021

I have a feeling there might be other ways to create bagception (now or in the future)..
Since you've worked through the code already, would it be possible/easy to also add a debugmsg when the bagception actually occurs? ("This is out of scope of this PR" would be a valid answer though)

@Jamuro-g
Copy link
Contributor Author

I have a feeling there might be other ways to create bagception (now or in the future)..
Since you've worked through the code already, would it be possible/easy to also add a debugmsg when the bagception actually occurs? ("This is out of scope of this PR" would be a valid answer though)

I took a quick glance and made a note for later, but i don't think i am familiar enough with the code yet to confidently make changes in visitable.cpp
From what i ve seen the best/only locations to implement such a check would be in item::put_in() but at that point we are already inside items that are unaware of their item_locations.
What's left is to adjust visitables, which i think is basically handling pretty much any and all item navigaion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Containers disappear when trying to contain parent from inside
5 participants