Update submodule, fix a bunch of warnings.

This commit is contained in:
Pieter-Jan Briers
2021-02-23 22:26:59 +01:00
parent ade8c6115b
commit 5a7658a13b
24 changed files with 40 additions and 43 deletions

View File

@@ -43,7 +43,7 @@ namespace Content.Server.GameObjects.Components.BarSign
return;
}
if (!_prototypeManager.TryIndex(_currentSign, out BarSignPrototype prototype))
if (!_prototypeManager.TryIndex(_currentSign, out BarSignPrototype? prototype))
{
Logger.ErrorS("barSign", $"Invalid bar sign prototype: \"{_currentSign}\"");
return;

View File

@@ -136,7 +136,7 @@ namespace Content.Server.GameObjects.Components.Cargo
break;
}
PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product);
PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype? product);
if (product == null!)
break;
var capacity = _cargoConsoleSystem.GetCapacity(orders.Database.Id);
@@ -184,7 +184,7 @@ namespace Content.Server.GameObjects.Components.Cargo
orders.Database.ClearOrderCapacity();
foreach (var order in approvedOrders)
{
if (!PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product))
if (!PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype? product))
continue;
for (var i = 0; i < order.Amount; i++)
{

View File

@@ -103,7 +103,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
{
if (string.IsNullOrEmpty(_packPrototypeId)) return;
if (!_prototypeManager.TryIndex(_packPrototypeId, out ReagentDispenserInventoryPrototype packPrototype))
if (!_prototypeManager.TryIndex(_packPrototypeId, out ReagentDispenserInventoryPrototype? packPrototype))
{
return;
}

View File

@@ -81,7 +81,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
//Only reagents with spritePath property can change appearance of transformable containers!
if (!string.IsNullOrWhiteSpace(reagentId) &&
_prototypeManager.TryIndex(reagentId, out ReagentPrototype proto) &&
_prototypeManager.TryIndex(reagentId, out ReagentPrototype? proto) &&
!string.IsNullOrWhiteSpace(proto.SpriteReplacementPath))
{
var spriteSpec = new SpriteSpecifier.Rsi(new ResourcePath("Objects/Consumable/Drinks/" + proto.SpriteReplacementPath),"icon");

View File

@@ -480,7 +480,7 @@ namespace Content.Server.GameObjects.Components.Construction
return;
}
if (_prototypeManager.TryIndex(_graphIdentifier, out ConstructionGraphPrototype graph))
if (_prototypeManager.TryIndex(_graphIdentifier, out ConstructionGraphPrototype? graph))
{
GraphPrototype = graph;

View File

@@ -337,7 +337,7 @@ namespace Content.Server.GameObjects.Components.Metabolism
// Using ToList here lets us edit reagents while iterating
foreach (var reagent in bloodstream.Solution.ReagentList.ToList())
{
if (!_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype prototype))
if (!_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype? prototype))
{
continue;
}

View File

@@ -65,7 +65,7 @@ namespace Content.Server.GameObjects.Components.Research
switch (message.Message)
{
case LatheQueueRecipeMessage msg:
PrototypeManager.TryIndex(msg.ID, out LatheRecipePrototype recipe);
PrototypeManager.TryIndex(msg.ID, out LatheRecipePrototype? recipe);
if (recipe != null!)
for (var i = 0; i < msg.Quantity; i++)
{

View File

@@ -55,7 +55,7 @@ namespace Content.Server.GameObjects.Components.Research
switch (message.Message)
{
case ConsoleUnlockTechnologyMessage msg:
if (!_prototypeManager.TryIndex(msg.Id, out TechnologyPrototype tech)) break;
if (!_prototypeManager.TryIndex(msg.Id, out TechnologyPrototype? tech)) break;
if (client.Server == null) break;
if (!client.Server.CanUnlockTechnology(tech)) break;
if (client.Server.UnlockTechnology(tech))

View File

@@ -77,7 +77,7 @@ namespace Content.Server.GameObjects.Components.VendingMachines
private void InitializeFromPrototype()
{
if (string.IsNullOrEmpty(_packPrototypeId)) { return; }
if (!_prototypeManager.TryIndex(_packPrototypeId, out VendingMachineInventoryPrototype packPrototype))
if (!_prototypeManager.TryIndex(_packPrototypeId, out VendingMachineInventoryPrototype? packPrototype))
{
return;
}