From ca62beb91f31f0566afc22465f10178127e64a62 Mon Sep 17 00:00:00 2001
From: Remuchi <72476615+Remuchi@users.noreply.github.com>
Date: Fri, 28 Jun 2024 16:19:47 +0700
Subject: [PATCH] =?UTF-8?q?fix:=20=D1=84=D0=B8=D0=BA=D1=81=20=D0=BA=D1=80?=
=?UTF-8?q?=D0=B0=D1=88=D0=B0=20=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=BE?=
=?UTF-8?q?=D0=B2=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D0=BD=D0=B0=D1=81?=
=?UTF-8?q?=D1=82=D0=BE=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=B8=D0=B3=D1=80?=
=?UTF-8?q?=D1=8B=20(#389)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Tabletop/Components/TabletopGameComponent.cs | 14 ++++++++++++++
Content.Server/Tabletop/TabletopSystem.cs | 13 +++++++++++++
Resources/Locale/en-US/tabletop/tabletop.ftl | 1 +
Resources/Locale/ru-RU/tabletop/tabletop.ftl | 1 +
4 files changed, 29 insertions(+)
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