Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Fixed giving translators #190

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Content.Server/Station/Systems/StationSpawningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
using Content.Shared.Bank.Components;
using Content.Shared._NF.Bank.Events;
using FastAccessors.Monads;
using Robust.Server.Player; // DeltaV
using Robust.Server.Player;
using Content.Shared.Corvax.Language.Components;
using Content.Shared.Hands.EntitySystems; // DeltaV

namespace Content.Server.Station.Systems;

Expand All @@ -54,6 +56,8 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
[Dependency] private readonly SharedAccessSystem _accessSystem = default!;
[Dependency] private readonly IdentitySystem _identity = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;

[Dependency] private readonly ArrivalsSystem _arrivalsSystem = default!;
[Dependency] private readonly ContainerSpawnPointSystem _containerSpawnPointSystem = default!;
Expand Down Expand Up @@ -239,6 +243,13 @@ public EntityUid SpawnPlayerMob(
}
}

if (HasComp<GiveTranslatorComponent>(entity.Value))
{
var coords = _transform.GetMapCoordinates(entity.Value);
var translatorEntity = EntityManager.SpawnEntity("Translator", coords);
_hands.TryForcePickupAnyHand(entity.Value, translatorEntity, checkActionBlocker: false);
}

var bank = EnsureComp<BankAccountComponent>(entity.Value);
bank.Balance = bankBalance;
if (_playerManager.TryGetSessionByEntity(entity.Value, out var player))
Expand Down
9 changes: 0 additions & 9 deletions Content.Shared/Station/SharedStationSpawningSystem.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Content.Shared.Corvax.Language.Components;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Inventory;
using Content.Shared.Roles;
using Content.Shared.VulpLangauge;
using Content.Shared.Storage;
using Content.Shared.Storage.EntitySystems;
using Robust.Shared.Collections;
Expand Down Expand Up @@ -116,12 +114,5 @@ public void EquipStartingGear(EntityUid entity, StartingGearPrototype? startingG
var ev = new StartingGearEquippedEvent(entity);
RaiseLocalEvent(entity, ref ev, true);
}

if (HasComp<GiveTranslatorComponent>(entity))
{
var coords = _xformSystem.GetMapCoordinates(entity);
var translatorEntity = EntityManager.SpawnEntity("Translator", coords);
_handsSystem.TryForcePickupAnyHand(entity, translatorEntity, checkActionBlocker: false, handsComp: handsComponent);
}
}
}
Loading