Skip to content

Commit 919e001

Browse files
Dream (Don't) Drop Loadout (#5494)
## Short description #4958 + Dynamic made it so you can roll antags later into the round, but this can actually lead to a problem where you end up dropping gear on the floor. This tries to fix that by dropping things from your equipped back storage onto the ground if there's not enough room, and, if you're not weaing back storage, putting it in your hands instead. When both those cases fail, only then will it drop stuff on the floor. Pun Pun and others without back storage would actually never get their gear, so this also allows them to get it via the hand equip. As I always state when I use AI, I had AI assistance in creating this PR, mainly with deciphering and rewriting SharedStationSpawningSystem. ## Why we need to add this Antags dropping their stuff is a pretty bad new player trap. ## Media (Video/Screenshots) [Content.Client_Kkm9myix1d.webm](https://github.com/user-attachments/assets/3ca35e6a-6b75-4a2b-acfa-7a036d114302) [Content.Client_6O0N1zPo4J.webm](https://github.com/user-attachments/assets/33e488f3-1a10-45f0-877a-3397f365b4bd) <img width="363" height="414" alt="image" src="https://github.com/user-attachments/assets/eeef771c-dea3-41e2-b8a1-0f152ab38845" /> ## Checks - [X] I do not require assistance to complete the PR. - [X] Before posting/requesting review of a PR, I have verified that the changes work. - [X] I have added screenshots/videos of the changes, or this PR does not change in-game mechanics. - [X] I affirm that my changes are licensed under the [MIT License](https://github.com/ss14Starlight/space-station-14/blob/Starlight/LICENSE.TXT) and grant permission for use in this repository under its conditions. **Changelog** :cl: wonderfulnewworld - fix: When you roll an antag that adds items to your inventory, if your back storage doesn't have enough room, it'll drop enough items from your back storage to fit your new gear in. If you're not wearing back storage, or your back storage is too small, it'll put them in your hands instead. Failing both of those cases, then it'll drop them on the floor. - fix: Pun Pun and other non-bag equippers can now actually get their Thief and SELF gear.
1 parent 373ba58 commit 919e001

3 files changed

Lines changed: 263 additions & 48 deletions

File tree

Content.Server/Antag/AntagSelectionSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ private void InitializeAntag(Entity<AntagSelectionComponent> gameRule, AntagSpec
11581158
gear.Add(prototype.StartingGear.Value);
11591159

11601160
var selectedLoadout = GetSelectedLoadout(player, selectedProfile, prototype.RoleLoadout, out var selectedLoadoutProto); // Starlight, antag loadouts
1161-
_loadout.Equip(antag, gear, prototype.RoleLoadout, selectedLoadout, selectedLoadoutProto); // Starlight
1161+
_loadout.Equip(antag, gear, prototype.RoleLoadout, selectedLoadout, selectedLoadoutProto, prioritizeBackStorage: true); // Starlight
11621162

11631163
// Ensure that we have the right mind for our entity.
11641164
if (!_mind.TryGetMind(player, out var mind, out var mindComp) || mindComp.OwnedEntity != antag)

Content.Shared/Clothing/LoadoutSystem.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,20 @@ public void Equip(EntityUid uid, List<ProtoId<StartingGearPrototype>>? startingG
153153
// Starlight edit Start: Antag Loadouts
154154
List<ProtoId<RoleLoadoutPrototype>>? loadoutGroups,
155155
RoleLoadout? selectedLoadout = null,
156-
RoleLoadoutPrototype? selectedLoadoutProto = null)
156+
RoleLoadoutPrototype? selectedLoadoutProto = null, // Starlight
157+
bool prioritizeBackStorage = false) // Starlight
157158
// Starlight edit End
158159
{
160+
var priorityContext = prioritizeBackStorage ? new PriorityStorageEquipContext() : null; // Starlight
161+
159162
// First, randomly pick a startingGear profile from those specified, and equip it.
160163
if (startingGear != null && startingGear.Count > 0)
161-
_station.EquipStartingGear(uid, _random.Pick(startingGear), false);
164+
_station.EquipStartingGear(uid, _random.Pick(startingGear), false, priorityContext); // Starlight
162165

163166
// Starlight Start: Antag Loadouts
164167
if (selectedLoadout != null && selectedLoadoutProto != null)
165168
{
166-
_station.EquipRoleLoadout(uid, selectedLoadout, selectedLoadoutProto);
169+
_station.EquipRoleLoadout(uid, selectedLoadout, selectedLoadoutProto, null, priorityContext);
167170
GearEquipped(uid);
168171
return;
169172
}
@@ -181,7 +184,7 @@ public void Equip(EntityUid uid, List<ProtoId<StartingGearPrototype>>? startingG
181184
var proto = _protoMan.Index(id);
182185
var loadout = new RoleLoadout(id);
183186
loadout.SetDefault(GetProfile(uid), _actors.GetSession(uid), _protoMan, true);
184-
_station.EquipRoleLoadout(uid, loadout, proto);
187+
_station.EquipRoleLoadout(uid, loadout, proto, null, priorityContext); // Starlight
185188

186189
GearEquipped(uid);
187190
}

0 commit comments

Comments
 (0)