Ensure any equipment incompatibility refs are enforced (#362)

Regardless of the order of loading
master
phkb 2020-08-12 15:56:55 +10:00 committed by GitHub
parent 364b68d1e9
commit f999fe8658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -156,6 +156,14 @@ this.equipmentAdded = function(equip)
}
}
}
var eq_dict = this.$equipmentEnabled;
var eqIncompatible;
for (eqKey in eq_dict) {
eqIncompatible = EquipmentInfo.infoForKey(eqKey).incompatibleEquipment;
if (eqIncompatible && eqIncompatible.indexOf(equip) >= 0) {
player.ship.removeEquipment(eqKey);
}
}
this.$equipmentEnabled[equip] = 1;
};