cherry pick "Fix currency duplication bug (#32524)" (#1936)

Fix currency duplication bug (#32524)

Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
This commit is contained in:
Milon
2024-09-29 14:24:09 +00:00
committed by GitHub
co-authored by Leon Friedrich
parent 093bd1fcaa
commit ddcb212778
5 changed files with 66 additions and 22 deletions
+14
View File
@@ -100,6 +100,13 @@ namespace Content.Server.Stack
/// </summary>
public List<EntityUid> SpawnMultiple(string entityPrototype, int amount, EntityCoordinates spawnPosition)
{
if (amount <= 0)
{
Log.Error(
$"Attempted to spawn an invalid stack: {entityPrototype}, {amount}. Trace: {Environment.StackTrace}");
return new();
}
var spawns = CalculateSpawns(entityPrototype, amount);
var spawnedEnts = new List<EntityUid>();
@@ -116,6 +123,13 @@ namespace Content.Server.Stack
/// <inheritdoc cref="SpawnMultiple(string,int,EntityCoordinates)"/>
public List<EntityUid> SpawnMultiple(string entityPrototype, int amount, EntityUid target)
{
if (amount <= 0)
{
Log.Error(
$"Attempted to spawn an invalid stack: {entityPrototype}, {amount}. Trace: {Environment.StackTrace}");
return new();
}
var spawns = CalculateSpawns(entityPrototype, amount);
var spawnedEnts = new List<EntityUid>();