Cap ChemMaster label length (#12260)

* Cap ChemMaster label length

* Reroll for green checkmark
This commit is contained in:
0x6273
2022-10-28 19:43:59 +02:00
committed by GitHub
parent 3078e359c0
commit a2e6ab2d07
3 changed files with 12 additions and 0 deletions

View File

@@ -186,6 +186,10 @@ namespace Content.Server.Chemistry.EntitySystems
if (message.Dosage == 0 || message.Dosage > chemMaster.PillDosageLimit)
return;
// Ensure label length is within the character limit.
if (message.Label.Length > SharedChemMaster.LabelMaxLength)
return;
var needed = message.Dosage * message.Number;
if (!WithdrawFromBuffer(chemMaster, needed, user, out var withdrawal))
return;
@@ -227,6 +231,10 @@ namespace Content.Server.Chemistry.EntitySystems
if (message.Dosage == 0 || message.Dosage > solution.AvailableVolume)
return;
// Ensure label length is within the character limit.
if (message.Label.Length > SharedChemMaster.LabelMaxLength)
return;
if (!WithdrawFromBuffer(chemMaster, message.Dosage, user, out var withdrawal))
return;