Фиксы (#488)

* add material storage component to whitemoose

* fix pickaxe inventory size

* fix free sponsor only races

* invisible aghost no longer visible in ghost warp menu

* add migration for BoxTrashbag

* fix make wizard admin verb

* fixed wizard components swap and new wizard marks as wizard in ghost warp menu now

* Stop eating food if you drop it (#29854)

* Stop eating food if you drop it

* woops, unused param

* comments

---------

Co-authored-by: plykiya <plykiya@protonmail.com>

* Eating and Drinking Doafter Change (#30060)

My lawyer told me to do this

Co-authored-by: plykiya <plykiya@protonmail.com>

* ActivatableUI tweaks (#27448)

* ActivatableUI tweaks

* EntGotRemovedFromContainerMessage

* A

* Revert "ActivatableUI tweaks (#27448)"

This reverts commit 5b311c6fdbf77db6838bdcf9993b98272d4ebeac.

* fix eating food from containers

* fix double captain duffel

* add bible for chaplain loadout

* possible bad fix for double security headsets

---------

Co-authored-by: Plykiya <58439124+Plykiya@users.noreply.github.com>
Co-authored-by: plykiya <plykiya@protonmail.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
This commit is contained in:
ThereDrD0
2024-07-24 02:19:13 +03:00
committed by GitHub
parent a3ce41d6ea
commit 0d99c5afe7
12 changed files with 78 additions and 29 deletions

View File

@@ -201,16 +201,31 @@ namespace Content.Shared.Preferences
}
// TODO: This should eventually not be a visual change only.
public static HumanoidCharacterProfile Random(HashSet<string>? ignoredSpecies = null)
public static HumanoidCharacterProfile Random(HashSet<string>? ignoredSpecies = null, bool includeSponsor = false)
{
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var random = IoCManager.Resolve<IRobustRandom>();
// WD edit - fix free sponsor species
var speciesToIgnore = ignoredSpecies != null
? new HashSet<string>(ignoredSpecies)
: new HashSet<string>();
if (!includeSponsor)
{
var sponsorSpecies = prototypeManager.EnumeratePrototypes<SpeciesPrototype>()
.Where(x => x.SponsorOnly)
.Select(x => x.ID);
speciesToIgnore.UnionWith(sponsorSpecies);
}
var species = random.Pick(prototypeManager
.EnumeratePrototypes<SpeciesPrototype>()
.Where(x => ignoredSpecies == null ? x.RoundStart : x.RoundStart && !ignoredSpecies.Contains(x.ID))
.Where(x => !x.SponsorOnly && x.RoundStart && !speciesToIgnore.Contains(x.ID))
.ToArray()
).ID;
// WD edit end
return RandomWithSpecies(species);
}