Remove AllComponentsOneEntityDeleteTest (#19965)

* Remove AllComponentsOneEntityDeleteTest

* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
This commit is contained in:
Leon Friedrich
2023-09-10 12:35:05 +12:00
committed by GitHub
parent 41b0b0ac64
commit 2d71eec6f9
10 changed files with 13 additions and 144 deletions

View File

@@ -20,5 +20,5 @@ public sealed partial class RandomFillSolutionComponent : Component
/// Weighted random fill prototype Id. Used to pick reagent and quantity.
/// </summary>
[DataField("weightedRandomId", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<WeightedRandomFillSolutionPrototype>))]
public string WeightedRandomId { get; set; } = "default";
public string? WeightedRandomId;
}

View File

@@ -22,6 +22,9 @@ public sealed class SolutionRandomFillSystem : EntitySystem
private void OnRandomSolutionFillMapInit(EntityUid uid, RandomFillSolutionComponent component, MapInitEvent args)
{
if (component.WeightedRandomId == null)
return;
var target = _solutionsSystem.EnsureSolution(uid, component.Solution);
var pick = _proto.Index<WeightedRandomFillSolutionPrototype>(component.WeightedRandomId).Pick(_random);

View File

@@ -12,5 +12,5 @@ namespace Content.Server.Humanoid.Components;
public sealed partial class RandomHumanoidSpawnerComponent : Component
{
[DataField("settings", customTypeSerializer: typeof(PrototypeIdSerializer<RandomHumanoidSettingsPrototype>))]
public string SettingsPrototypeId = default!;
public string? SettingsPrototypeId;
}

View File

@@ -29,7 +29,8 @@ public sealed class RandomHumanoidSystem : EntitySystem
private void OnMapInit(EntityUid uid, RandomHumanoidSpawnerComponent component, MapInitEvent args)
{
QueueDel(uid);
SpawnRandomHumanoid(component.SettingsPrototypeId, Transform(uid).Coordinates, MetaData(uid).EntityName);
if (component.SettingsPrototypeId != null)
SpawnRandomHumanoid(component.SettingsPrototypeId, Transform(uid).Coordinates, MetaData(uid).EntityName);
}
public EntityUid SpawnRandomHumanoid(string prototypeId, EntityCoordinates coordinates, string name)

View File

@@ -246,7 +246,7 @@ namespace Content.Server.Light.EntitySystems
ApcPowerReceiverComponent? powerReceiver = null,
AppearanceComponent? appearance = null)
{
if (!Resolve(uid, ref light, ref powerReceiver))
if (!Resolve(uid, ref light, ref powerReceiver, false))
return;
// Optional component.

View File

@@ -120,7 +120,7 @@ public sealed class ApcSystem : EntitySystem
ApcComponent? apc=null,
PowerNetworkBatteryComponent? battery = null)
{
if (!Resolve(uid, ref apc, ref battery))
if (!Resolve(uid, ref apc, ref battery, false))
return;
var newState = CalcChargeState(uid, battery.NetworkBattery);

View File

@@ -57,7 +57,7 @@ internal sealed class SmesSystem : EntitySystem
private int CalcChargeLevel(EntityUid uid, BatteryComponent? battery = null)
{
if (!Resolve(uid, ref battery))
if (!Resolve(uid, ref battery, false))
return 0;
return ContentHelpers.RoundToLevels(battery.CurrentCharge, battery.MaxCharge, 6);
@@ -65,7 +65,7 @@ internal sealed class SmesSystem : EntitySystem
private ChargeState CalcChargeState(EntityUid uid, PowerNetworkBatteryComponent? netBattery = null)
{
if (!Resolve(uid, ref netBattery))
if (!Resolve(uid, ref netBattery, false))
return ChargeState.Still;
return (netBattery.CurrentSupply - netBattery.CurrentReceiving) switch

View File

@@ -172,10 +172,8 @@ namespace Content.Server.Solar.EntitySystems
SolarPanelComponent? solar = null,
PowerSupplierComponent? supplier = null)
{
if (!Resolve(uid, ref solar, ref supplier))
{
if (!Resolve(uid, ref solar, ref supplier, false))
return;
}
supplier.MaxSupply = (int) (solar.MaxSupply * solar.Coverage);
}