-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Transparent pockets? (Items in pockets visible from afar?) #73445
Comments
From that list only transparency got implemented. Everything else is still hidden.
I agree with that. The question is if you can tell what's inside a pocket when it's not within reach to actually check the contents. Originally posted by @mqrause in #73400 (comment) |
Looking back, a reason why I was so quick to change item_pocket.h // open pockets are always considered transparent //// "open" probably means "unclosable" or "bucket-like", as @mqrause explains bellow
bool transparent() const;
(...)
// the pocket will spill its contents if placed in another container //// so this is unclosable container, rather than open container
bool open_container = false;
(...)
// the contents of the pocket are visible
bool transparent = false; item_pocket.cpp bool item_pocket::sealed() const
{
if( !sealable() ) {
return false;
} else {
return _sealed;
}
}
(...)
bool item_pocket::transparent() const
{
return data->transparent || ( data->open_container && !sealed() ); //// should definitely be _sealed instead of sealed()
} |
An "open" pocket is something like a bucket. Meaning there's nothing holding the contents inside it besides gravity. Originally it was only used for "this container spills its contents if you try to put it into another container", but it got extended to "you can see the contents from a distance". It is explicitly not the opposite of "sealed". Although I'm not sure anymore how an open pocket could be sealed and why I added that check. But I assume there was a reason. |
Give me a sec, I am writing the same thing, sorry to call (ping) you before I had this done :( |
Can you review my code assessment made above? #73445 (comment) My conclusion: change |
Yeah, the comments can definitely be improved. I'm not sure what using |
If the container isn't sealable, the
That sounds like a separate issue. If it happens, it is a different bug. But I think this is currently bugged in for the above-mentioned reason. |
Closely related: Cataclysm-DDA/src/item_contents.h Lines 121 to 123 in 53a0a73
My understanding of the comment differs from what I understand the method does, The method So the comment should be changed and the function should be named Cataclysm-DDA/src/item_contents.cpp Lines 1737 to 1742 in 53a0a73
|
I think you're misreading that. If it's not sealable it's not sealed. So an unsealable bucket is transparent. Unless you can show me it's broken ingame.
That's correct and I agree. It's used in recursive contexts, so the implementation works as intended and I wouldn't change it, unless you want to do more/different stuff with it. |
Fair, I didn't find it. So let's leave it. |
Pockets that aren't transparent should also not leak info about their weight (can have: |
I am letting go for now. But it is a problem that right now nobody really knows how it should be. It is not easy to figure out and it is not trivial to implement. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered. |
Continuing discussion opened in #73400 about transparent pockets.
The text was updated successfully, but these errors were encountered: