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

Don't allow to scan books that are owned by other characters #65927

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

Demivan
Copy link
Contributor

@Demivan Demivan commented May 30, 2023

Summary

Bugfixes "Don't allow to scan books that are owned by other characters"

Purpose of change

Fixes #65840

It was possible to scan books from merchant inventory without buying them.

Describe the solution

Add is_owned_by check when selecting books for the list of books to scan, filtering out books that character does not have access to.

Describe alternatives you've considered

Keep displaying all books, but mark owned ones and allow stealing them when scanning.

Testing

  1. Spawn Exodia base.
  2. Check that books in merchant inventory are not listed for scanning.
  3. Spawn a refuge center.
  4. Check that books that you cannot pick up (would be stealing) are not listed for scanning.
  5. Check that books in a library and in houses are still scannable.

Additional context

Seems like there is a similar issue with reading. It allows reading books in refuge center that the character cannot pick up, as that would be stealing.

It was possible to scan books from merchant inventory without
buying them.

fixes CleverRaven#65840
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) labels May 30, 2023
src/iuse.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label May 30, 2023
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label May 30, 2023
@Qrox
Copy link
Contributor

Qrox commented May 30, 2023

Keep displaying all books, but mark owned ones and allow stealing them when scanning.

Actually I would prefer this alternative, so that I can lure NPCs out and pirate their books without them knowing.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 30, 2023
@anoobindisguise
Copy link
Contributor

I think this is very silly. The value of the book is the physical print that doesn't need any power to be read, not its intellectual property. It is literally would cost the refugee center nothing to let you scan their books, and presumably survivors want to help each other survive rather than perpetuate one of the most arbitrary creations of capitalism. Nothing is actually being stolen. On the other hand the physical print of the book is the actual object that would be lost if you took it (they wouldn't have it anymore)

@Maleclypse
Copy link
Member

I think this is very silly. The value of the book is the physical print that doesn't need any power to be read, not its intellectual property. It is literally would cost the refugee center nothing to let you scan their books, and presumably survivors want to help each other survive rather than perpetuate one of the most arbitrary creations of capitalism. Nothing is actually being stolen. On the other hand the physical print of the book is the actual object that would be lost if you took it (they wouldn't have it anymore)

I think this suggests two solutions. One we assume that since books are highly valued as trade items that factions won't allow non faction members to scan their books. Or two we make books worthless outside of quests and broker actions and the freedom of information exists.

I vote for the first solution because it doesn't require us to rejigger the in game economy.

@Maleclypse Maleclypse merged commit b43755d into CleverRaven:master Jun 19, 2023
@Demivan Demivan deleted the scan-owned-books branch June 24, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It is possible to scan books in merchant's inventory without buying them
4 participants