Makes players spawn on job spawn markers on roundstart (#543)
* Adds job type to spawn points, makes players spawn on job spawn markers on roundstart * Update Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs Co-Authored-By: Pieter-Jan Briers <pieterjan.briers@gmail.com> Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
committed by
Pieter-Jan Briers
parent
1996893a26
commit
09a27df6db
@@ -1,5 +1,8 @@
|
||||
using Content.Shared.GameObjects.Components.Markers;
|
||||
using Content.Shared.Jobs;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -9,15 +12,24 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
[ComponentReference(typeof(SharedSpawnPointComponent))]
|
||||
public sealed class SpawnPointComponent : SharedSpawnPointComponent
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private SpawnPointType _spawnType;
|
||||
[ViewVariables]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
private string _jobId;
|
||||
public SpawnPointType SpawnType => _spawnType;
|
||||
public JobPrototype Job => string.IsNullOrEmpty(_jobId) ? null
|
||||
: _prototypeManager.Index<JobPrototype>(_jobId);
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
|
||||
serializer.DataField(ref _spawnType, "spawn_type", SpawnPointType.Unset);
|
||||
serializer.DataField(ref _jobId, "job_id", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,5 +37,6 @@ namespace Content.Server.GameObjects.Components.Markers
|
||||
{
|
||||
Unset = 0,
|
||||
LateJoin,
|
||||
Job,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user