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

Atomic reactor enable/disable + spam fix #26622

Merged
merged 3 commits into from Nov 10, 2018

Conversation

Projects
None yet
3 participants
@Josephos
Copy link
Contributor

commented Nov 10, 2018

Changes to be committed:
modified: src/vehicle.cpp

Summary

SUMMARY: Bugfixes "Fix for issue #26617 "

Purpose of change

Fixes #26617 mini-reactor is always on regardless of setting, reactor with no fuel spams shutdown messages.

Describe the solution

Added some code to check whether or not the reactor is actually on. If there are no online reactors, there is nothing to turn off, so we can skip disabling them and spamming in the process.

Describe alternatives you've considered

I've considered leaving this alone and letting someone who knows what the hell is he doing to fix it instead.

s@s.com
On branch atomic_reactor_fix
 Changes to be committed:
	modified:   src/vehicle.cpp

 Changes not staged for commit:

@Josephos Josephos changed the title On branch atomic_reactor_fix Atomic reactor enable/disable + spam fix Nov 10, 2018

s@s.com
@AMurkin

This comment has been minimized.

Copy link
Contributor

commented Nov 10, 2018

You don't need count, only on/off state.

    bool reactor_online = false;
    for( auto &elem : reactors ) {
        reactor_online |= is_part_on( elem );
    }
Added comments, changed the tracking variable to bool, as we don't ne…
…ed to know the exact number of online reactors.

@ZhilkinSerg ZhilkinSerg merged commit 94a20a2 into CleverRaven:master Nov 10, 2018

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
gorgon-ghprb Build finished.
Details

@Josephos Josephos deleted the Josephos:atomic_reactor_fix branch Nov 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.