Doesn't block an equipment installation if an incompatible equipment had been installed but has already been removed #369
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.
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)