The main reason to do it that way is to reduce the amount of equipment in the equipment list. My first release was in the form of normal equipment. But at that time the equipment list could not be wrapped and would fall of the bottom of the screen when it became to long. I had several request to not add new equipment, so I decided to make it part of other equipment. The "Scanner Targeting Enhancement" in this case .Capt. Murphy wrote:On the other hand both Target Autolock and Target Reticle Sensitive appear to have been deliberately scripted by their authors (Thargoid and Eric respectively) to be removed when Scanner Targeting Enhancement is damaged.
I now see it as an expensive modification on the "Scanner Targeting Enhancement", and when that breaks, the modification is also destroyed in the process.
Back to the original problem. I just committed a version r4598 were the condition check is skipped for equipment damaged in combat.
When damaged, equipment is always completely removed and than replaced by a version with "_DAMAGED" appended. In the past that was a fully independent equipment because of the different name. And for that damaged equipment no conditions existed and the code would always award the 'new' equipment.
But, at some point in the past, the damaged version became the original with a special flag set. The code is now fully non-logic and probably should just switch that flag, instead of removing and awarding stuff. However, having a feature lock it is better to stay away from fully refactoring and going for the simple solution and just skip the conditions check.
For the JS 'awardEquipment' method it would also be easy to add a second [optional] boolean parameter for checking the condition. Default would be yes, so existing commands won't change. That change needs the opinion of other dev members: if that would be a new feature or just correcting an incomplete implementation of the old method.
(It would be a trivial change that I already made and tested in my personal oolite copy, but I am not sure if it is correct to allow scripts to bypass the conditions, other than repairing already existing equipment.)