Skip to content

Commit 5242ceb

Browse files
committed
Make AI Not Spawn With Clothes
1 parent 0b0e9a8 commit 5242ceb

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

Content.Server/Traits/TraitSystem.cs

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args)
4848
{
4949
var pointsTotal = _configuration.GetCVar(CCVars.GameTraitsDefaultPoints);
5050
var traitSelections = _configuration.GetCVar(CCVars.GameTraitsMax);
51+
if (args.JobId is not null && !_prototype.TryIndex<JobPrototype>(args.JobId, out var jobPrototype)
52+
&& jobPrototype is not null && !jobPrototype.ApplyTraits)
53+
return;
5154

5255
foreach (var traitId in args.Profile.TraitPreferences)
5356
{

Content.Shared/Clothing/Loadouts/Systems/SharedLoadoutSystem.cs

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ private void OnMapInit(EntityUid uid, LoadoutComponent component, MapInitEvent a
7575
var failedLoadouts = new List<EntityUid>();
7676
var allLoadouts = new List<(EntityUid, LoadoutPreference, int)>();
7777
heirlooms = new();
78+
if (!job.SpawnLoadout)
79+
return (failedLoadouts, allLoadouts);
7880

7981
foreach (var loadout in profile.LoadoutPreferences)
8082
{

Content.Shared/Roles/JobPrototype.cs

+6
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ public sealed partial class JobPrototype : IPrototype
134134

135135
[DataField]
136136
public bool Whitelisted;
137+
138+
[DataField]
139+
public bool SpawnLoadout = true;
140+
141+
[DataField]
142+
public bool ApplyTraits = true;
137143
}
138144

139145
/// <summary>

Resources/Prototypes/Roles/Jobs/Science/borg.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
supervisors: job-supervisors-rd
1414
jobEntity: StationAiBrain
1515
nameDataset: NamesAI
16+
spawnLoadout: false
17+
applyTraits: false
1618

1719
- type: job
1820
id: Borg
@@ -25,4 +27,4 @@
2527
canBeAntag: false
2628
icon: JobIconBorg
2729
supervisors: job-supervisors-rd
28-
jobEntity: PlayerBorgGeneric
30+
jobEntity: PlayerBorgGeneric

0 commit comments

Comments
 (0)