Make more uids nullable (#5794)
This commit is contained in:
@@ -42,7 +42,7 @@ namespace Content.Server.Stack
|
||||
public EntityUid? Split(EntityUid uid, int amount, EntityCoordinates spawnPosition, SharedStackComponent? stack = null)
|
||||
{
|
||||
if (!Resolve(uid, ref stack))
|
||||
return default;
|
||||
return null;
|
||||
|
||||
// Get a prototype ID to spawn the new entity. Null is also valid, although it should rarely be picked...
|
||||
var prototype = _prototypeManager.TryIndex<StackPrototype>(stack.StackTypeId, out var stackType)
|
||||
@@ -51,7 +51,7 @@ namespace Content.Server.Stack
|
||||
|
||||
// Try to remove the amount of things we want to split from the original stack...
|
||||
if (!Use(uid, amount, stack))
|
||||
return default;
|
||||
return null;
|
||||
|
||||
// Set the output parameter in the event instance to the newly split stack.
|
||||
var entity = Spawn(prototype, spawnPosition);
|
||||
|
||||
Reference in New Issue
Block a user