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

Clean some bionic activation code #37813

Merged
merged 5 commits into from
Mar 2, 2020
Merged

Clean some bionic activation code #37813

merged 5 commits into from
Mar 2, 2020

Conversation

olanti-p
Copy link
Contributor

@olanti-p olanti-p commented Feb 7, 2020

Summary

SUMMARY: Infrastructure "Clean some cases in bionic activation code"

Purpose of change

Bionic activation messages are sometimes weird or misleading (e.g. #33663). Failure to activate a bionic sometimes returns as a success or consumes power when it shouldn't. This is an effort to fix the majority of these issues

Describe the solution

I went through all paths and made sure You activate your CBM message displayed only when it makes sense; the power spent is properly returned on failure / if bionic is not used; bionic turned off if it fails to activate and false is returned.

Describe alternatives you've considered

Leaving it as is until the bionic overhaul

Testing

It compiles, gives the player some message(s) on all paths and shouldn't break external code because no one except NPCs cares about returned value, and none of the bionics I changed are usable by NPCs.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Bionics CBM (Compact Bionic Modules) Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Feb 7, 2020
src/bionics.cpp Outdated Show resolved Hide resolved
@olanti-p olanti-p changed the title Clean up bionic activation code Clean some bionic activation code Feb 21, 2020
@kevingranade kevingranade merged commit 8fa82de into CleverRaven:master Mar 2, 2020
@olanti-p olanti-p deleted the fix-bionics-messages branch March 2, 2020 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bionics CBM (Compact Bionic Modules) [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants