* Prevent borgs from getting duplicate modules
* outta the loop
---------
Co-authored-by: plykiya <plykiya@protonmail.com>
return false;
}
+ if (TryComp<ItemBorgModuleComponent>(module, out var itemModuleComp))
+ {
+ foreach (var containedModuleUid in component.ModuleContainer.ContainedEntities)
+ {
+ if (!TryComp<ItemBorgModuleComponent>(containedModuleUid, out var containedItemModuleComp))
+ continue;
+
+ for (int i = 0; i < itemModuleComp.Items.Count; i++)
+ {
+ if (itemModuleComp.Items[i] != containedItemModuleComp.Items[i])
+ continue;
+ }
+
+ if (user != null)
+ Popup.PopupEntity(Loc.GetString("borg-module-duplicate"), uid, user.Value);
+ return false;
+ }
+ }
+
return true;
}
-borg-player-not-allowed = The brain doesn't fit!
+borg-player-not-allowed = The brain doesn't fit!
borg-player-not-allowed-eject = The brain was expelled from the chassis!
borg-panel-not-open = The cyborg's panel isn't open...
borg-mind-removed = {CAPITALIZE($name)} shut off!
borg-module-too-many = There's not enough room for another module...
+borg-module-duplicate = This module is already installed in this cyborg.
borg-module-whitelist-deny = This module doesn't fit in this type of cyborg...
borg-construction-guide-string = The cyborg limbs and torso must be attached to the endoskeleton.