Fixes #5348 - no gun cooling after selling laser cooler#5426
Merged
sturnclaw merged 1 commit intopioneerspacesim:masterfrom Nov 24, 2022
Merged
Fixes #5348 - no gun cooling after selling laser cooler#5426sturnclaw merged 1 commit intopioneerspacesim:masterfrom
sturnclaw merged 1 commit intopioneerspacesim:masterfrom
Conversation
sturnclaw
approved these changes
Nov 21, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ship without laser cooler installed ever -> no property laser_cooler_cap -> Ship::UpdateGunsStats defaults to 1
Buy laser cooler -> lua bumps laser_cooler_cap from non existence to 2
Sell laser cooler -> lua decreases laser_cooler_cap from 2 to 0 -> Ship::UpdateGunsStats sets cooling boost to 0 -> no cooling
I am not sure if what I propose is the proper way to fix it. Maybe all ships should have it's base laser_cooler_cap defined and buying the cooler would bump it up or down from lua. Maybe it should be defaulted in Ship constructor. Maybe it should be defaulted somewhere in lua. What I've done is certainly easiest and I think consistent with original code intent.