fix: фикс краша серверов через настольные игры (#389)

This commit is contained in:
Remuchi
2024-06-28 16:19:47 +07:00
committed by GitHub
parent c28f5648d0
commit ca62beb91f
4 changed files with 29 additions and 0 deletions

View File

@@ -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<ItemComponent>(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;