Borg tweaks (#19046)

* borg tweaks

* wahoo
This commit is contained in:
Nemanja
2023-08-13 03:09:30 -04:00
committed by GitHub
parent 6edd731833
commit 812cceae9d
9 changed files with 110 additions and 10 deletions

View File

@@ -42,9 +42,6 @@ public sealed partial class BorgSystem
{
var chassis = args.Container.Owner;
if (Terminating(chassis))
return;
if (!TryComp<BorgChassisComponent>(chassis, out var chassisComp) ||
args.Container != chassisComp.ModuleContainer)
return;
@@ -232,7 +229,11 @@ public sealed partial class BorgSystem
return false;
if (component.ModuleContainer.ContainedEntities.Count >= component.MaxModules)
{
if (user != null)
Popup.PopupEntity(Loc.GetString("borg-module-too-many"), uid, user.Value);
return false;
}
if (component.ModuleWhitelist?.IsValid(module, EntityManager) == false)
{

View File

@@ -69,8 +69,14 @@ public sealed partial class BorgSystem
if (TryComp<NameIdentifierComponent>(uid, out var identifier))
name = $"{name} {identifier.FullIdentifier}";
_metaData.SetEntityName(uid, name);
var metaData = MetaData(uid);
// don't change the name if the value doesn't actually change
if (metaData.EntityName.Equals(name, StringComparison.InvariantCulture))
return;
_adminLog.Add(LogType.Action, LogImpact.High, $"{ToPrettyString(attachedEntity):player} set borg \"{ToPrettyString(uid)}\"'s name to: {name}");
_metaData.SetEntityName(uid, name, metaData);
}
private void OnRemoveModuleBuiMessage(EntityUid uid, BorgChassisComponent component, BorgRemoveModuleBuiMessage args)