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

Add UPS conversion support to Bionic Scanner #1797

Merged

Conversation

KheirFerrum
Copy link
Collaborator

@KheirFerrum KheirFerrum commented Aug 22, 2022

Summary

SUMMARY: Bugfixes "Make Bionic Scanners work with UPS Conversion Mods"

Purpose of change

If a bionic scanner has the UPS conversion mod installed, it will simply fail the moment you get close to a bionic carrying monster, as the note_bionics iuse has no support for the USE_UPS flag.

Fixes #1133

Describe the solution

Adds a check to ensure that the bionic scanner is possessed by the character, and if there's not enough charge in the device (automatic since ups conversion mods remove the internal battery) it will draw from any UPS source you have instead.

Describe alternatives you've considered

  • Make bionic scanners go by power_draw instead.
    Rejected on basis of reward/resource consumption mismatch.

Testing

New game, spawned in bionic scanner. Installed ups conversion mod. Spawned bio-operator, killed bio-operator. Repeated while I checked several things.

  • Draws appropriately from UPS, Advanced UPS and UPS CBM.
  • Does not draw power from you while it is not on your person.

Additional context

@KheirFerrum KheirFerrum force-pushed the NOTE_BIONIC-USE_UPS-fix branch from 3e3343f to ce58c95 Compare August 22, 2022 13:56
Copy link
Contributor

@olanti-p olanti-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the function should return amount of charges to use and let the caller sort out drawing them from UPS, but that seems impossible with this one as it is essentially "invoked" multiple times per invocation.

@olanti-p olanti-p merged commit ab009dc into cataclysmbnteam:upload Aug 25, 2022
@KheirFerrum KheirFerrum deleted the NOTE_BIONIC-USE_UPS-fix branch August 28, 2022 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UPS bionic scanner shuts down when it tries to scan corpse
2 participants