X Tutup
Skip to content

Fixes #5348 - no gun cooling after selling laser cooler#5426

Merged
sturnclaw merged 1 commit intopioneerspacesim:masterfrom
azieba:fix_laser_cooler
Nov 24, 2022
Merged

Fixes #5348 - no gun cooling after selling laser cooler#5426
sturnclaw merged 1 commit intopioneerspacesim:masterfrom
azieba:fix_laser_cooler

Conversation

@azieba
Copy link
Contributor

@azieba azieba commented Nov 20, 2022

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.

@sturnclaw sturnclaw merged commit d8d7e5b into pioneerspacesim:master Nov 24, 2022
@azieba azieba deleted the fix_laser_cooler branch November 24, 2022 16:05
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.

2 participants

X Tutup