demiplane crates fix #589 (#599)

* demiplane crates fix #589

* change component to MapGridComponent

* simplification

* Update CP14DemiplanSystem.Generation.cs

---------

Co-authored-by: Ed <edwardxperia2000@gmail.com>
This commit is contained in:
A.Ne.
2024-11-21 00:37:44 +04:00
committed by GitHub
parent 4abd793ef9
commit 4fcfab972d
3 changed files with 6 additions and 4 deletions

View File

@@ -14,6 +14,8 @@ using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Robust.Shared.Map.Components;
namespace Content.Server._CP14.Demiplane;
@@ -139,8 +141,8 @@ public sealed partial class CP14DemiplaneSystem
if (generator.Comp.Location is null)
return;
//We cant open demiplan in another demiplan
if (HasComp<CP14DemiplaneComponent>(Transform(generator).MapUid))
//We cant open demiplan in another demiplan or if parent is not Map
if (HasComp<CP14DemiplaneComponent>(Transform(generator).MapUid) || !HasComp<MapGridComponent>(_transform.GetParentUid(args.User)))
{
_popup.PopupEntity(Loc.GetString("cp14-demiplan-cannot-open", ("name", MetaData(generator).EntityName)), generator, args.User);
return;

View File

@@ -1,3 +1,3 @@
cp14-demiplan-active-rift-warning = {$name} begins dragging surrounding creatures into the demiplane!
cp14-demiplan-cannot-open = You can't use {$name} here.
cp14-demiplan-cannot-open = You can't use {$name} here.

View File

@@ -1,3 +1,3 @@
cp14-demiplan-active-rift-warning = {$name} начинает затягивать окружающих существ в демиплан!
cp14-demiplan-cannot-open = Вы не можете использовать {$name} здесь.
cp14-demiplan-cannot-open = Вы не можете использовать {$name} здесь.