Фикс уязвимости химкомата. (#2306)

Co-authored-by: haiwwkes <49613070+rhailrake@users.noreply.github.com>
Co-authored-by: Vigers Ray <vigersray@gmail.com>
This commit is contained in:
SplikZerys 2025-06-10 00:38:22 +03:00 committed by GitHub
parent aea4f57a13
commit a8d53b10e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -42,6 +42,8 @@ namespace Content.Server.Chemistry.EntitySystems
[ValidatePrototypeId<EntityPrototype>]
private const string PillPrototypeId = "Pill";
private const int MaxPillsPerRequest = 50; // Sunrise-Edit
public override void Initialize()
{
base.Initialize();
@ -200,6 +202,14 @@ namespace Content.Server.Chemistry.EntitySystems
if (message.Number == 0 || !_storageSystem.HasSpace((container, storage)))
return;
// Surnise-Start
if (message.Number > MaxPillsPerRequest)
{
_popupSystem.PopupCursor(Loc.GetString("chem-master-window-too-many-pills-text"), user);
return;
}
// Surnise-End
// Ensure the amount is valid.
if (message.Dosage == 0 || message.Dosage > chemMaster.Comp.PillDosageLimit)
return;

View file

@ -0,0 +1 @@
chem-master-window-too-many-pills-text = Вы не можете создать сколько таблеток.