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

Doesn't block an equipment installation if an incompatible equipment had been installed but has already been removed #369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dybal
Copy link

@dybal dybal commented Sep 22, 2020

An equipmentKey isn't removed from oolite-equipment-control's this.$equipmentEnabled dictionary keys when an equipment is removed, the value for that key is changed to 0 if the equipment was removed (and to 1 if it's installed or re-installed).

So not all keys in this.$equipmentEnabled represent equipments that are installed in the ship and it's necessary to check the value for that key in the dictionary to make sure the equipment is installed and only after that look for the equipments incompatible with it.

Without this correction, if an equipment was installed it would block the installation of equipments incompatible with it even after it was uninstalled.

To reproduce, install Smivs Battle Damage OXP and remove the equipment EQ_HULL_REPAIR from a ship and then try to award it back (it's incompatible with self)

…had been isntalled but has already been removed
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