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

Implement (R)eading e-book requirements, fix etransfer_rate segfault #79387

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

ShnitzelX2
Copy link
Contributor

@ShnitzelX2 ShnitzelX2 commented Jan 28, 2025

Summary

Bugfixes "implement (R)eading e-book requirements, fix etransfer_rate segfault"

Purpose of change

Closes #79011 (this was before the overhaul, but still relevant)

Reading e-devices from the (R)ead menu doesn't consume power or take into account e-device status (browsed/power/usable).

Also, somebody mentioned an error reading off of a camera on Discord, so I fixed that and added a debugmsg precaution (sorry about your save).

Describe the solution

  • Make reading off of an e-device require: "has power", "is browsed", and "is a usable e-device"
  • Make reading off of an e-device pass the e-device as a parameter to read() so that power is consumed
  • Fix a segfault related to division by 0 for uninitialized etransfer_rate, add a debug message if an item that should have etransfer_rate is missing it

Describe alternatives you've considered

Testing

  • Read normal book
  • Stored book on phone and read it, noted power loss
  • Ran phone out of power and confirmed book could not be read; did the same with AR bionic, atomic smartphone
  • Moved book to memory card and confirmed book could not be read (this may be desirable in the future, out of scope for now)
  • Confirmed files on an unbrowsed device could not be read
  • Made sure camera could transfer files

Additional context

The "study from books in order" NPC activity does not account for e-books, and it should also have been broken before the e-storage overhaul.

I think I'm comfortable enough with the e-storage infrastructure now to move on to adding more item groups, so expect that next.

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 28, 2025
@Maleclypse Maleclypse merged commit 4fb1c6d into CleverRaven:master Jan 29, 2025
30 of 31 checks passed
@adres4t-1
Copy link

and it should also have been broken before the e-storage overhaul - I'm not sure this is relevant, but it was working pretty well with all the devices, my NPC's were reading fine. Until bateries run out.

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] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

You can read e-books directly from USB
3 participants