diff --git a/Content.Server/Tabletop/Components/TabletopGameComponent.cs b/Content.Server/Tabletop/Components/TabletopGameComponent.cs
index da7a09b213..c22e2ba703 100644
--- a/Content.Server/Tabletop/Components/TabletopGameComponent.cs
+++ b/Content.Server/Tabletop/Components/TabletopGameComponent.cs
@@ -37,5 +37,19 @@ namespace Content.Server.Tabletop.Components
///
[ViewVariables]
public TabletopSession? Session { get; set; } = null;
+
+ // Skyedra Fix start
+ ///
+ /// How many holograms have been spawned onto this board.
+ ///
+ [ViewVariables]
+ public int HologramsSpawned { get; set; } = 0;
+
+ ///
+ /// How many holograms are allowed to be spawned total by players.
+ ///
+ [ViewVariables]
+ public int MaximumHologramsAllowed { get; set; } = 10;
+ // Skyedra Fix end
}
}
diff --git a/Content.Server/Tabletop/TabletopSystem.cs b/Content.Server/Tabletop/TabletopSystem.cs
index 4376ec4bc6..301f91622d 100644
--- a/Content.Server/Tabletop/TabletopSystem.cs
+++ b/Content.Server/Tabletop/TabletopSystem.cs
@@ -68,6 +68,9 @@ namespace Content.Server.Tabletop
// Find the entity, remove it from the session and set it's position to the tabletop
session.Entities.TryGetValue(entity, out var result);
session.Entities.Remove(result);
+
+ tabletop.HologramsSpawned--; // White Dream fix
+
QueueDel(result);
}
@@ -90,6 +93,16 @@ namespace Content.Server.Tabletop
if (!TryComp(handEnt, out var item))
return;
+ // Skye hotfix to prevent people from infinitely spawning mice on the board games and crashing server.
+ if (component.HologramsSpawned >= component.MaximumHologramsAllowed)
+ {
+ _popupSystem.PopupEntity(Loc.GetString("tabletop-max-entities"), uid, args.User);
+ return;
+ }
+
+ component.HologramsSpawned++;
+ // Skye hotfix end
+
var meta = MetaData(handEnt);
var protoId = meta.EntityPrototype?.ID;
diff --git a/Resources/Locale/en-US/tabletop/tabletop.ftl b/Resources/Locale/en-US/tabletop/tabletop.ftl
index b2bacd1649..30dd4d7f90 100644
--- a/Resources/Locale/en-US/tabletop/tabletop.ftl
+++ b/Resources/Locale/en-US/tabletop/tabletop.ftl
@@ -4,6 +4,7 @@ tabletop-verb-dump-pieces = Dump Pieces
tabletop-default-board-name = Board Game
tabletop-error-remove-non-hologram = You cant remove a built in piece!
tabletop-added-piece = The board shimmers brightly!
+tabletop-max-entities = Maximum number of holograms placed.
## Chess
tabletop-chess-board-name = Chess
diff --git a/Resources/Locale/ru-RU/tabletop/tabletop.ftl b/Resources/Locale/ru-RU/tabletop/tabletop.ftl
index 0eb4535fe6..19173cb7a3 100644
--- a/Resources/Locale/ru-RU/tabletop/tabletop.ftl
+++ b/Resources/Locale/ru-RU/tabletop/tabletop.ftl
@@ -5,6 +5,7 @@ tabletop-verb-dump-pieces = Сбросить куски
tabletop-default-board-name = Настольная игра
tabletop-error-remove-non-hologram = Вы не можете удалить встроенный элемент!
tabletop-added-piece = Доска ярко переливается!
+tabletop-max-entities = Максимальное количество голограмм уже поставлено.
## Chess