Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Station Only Glimmer Mites #976

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VMSolidus
Copy link
Member

Description

This PR makes it so that Glimmer Mites can only spawn on "The Main Station", as defined by GetSpawnableStations. Yes this is seemingly pretty hardcodey, but because on our codebase it's simply not possible for GetSpawnableStations to ever return anything other than a list with an index of 0, we can extremely reliably count on GetSpawnableStations()[0] to be "THE Station".

This fixes an issue whereby Glimmer Mites can spawn in places where it is simply not possible for players to reach them. Such as random asteroids in space, CENTCOMM, Nukie World, or the Syndicate Listening Outpost.

Changelog

🆑

  • fix: Glimmer Mites can no longer spawn anywhere other than "THE" Station.

@github-actions github-actions bot added the Changes: C# Changes any cs files label Sep 29, 2024
Copy link
Contributor

@Mnemotechnician Mnemotechnician left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(The suggestions are done with LINQ, you will have to add a using directive for it if your IDE doesn't add it automatically)

var glimmerSources = new List<(GlimmerSourceComponent, TransformComponent)>();
foreach (var source in EntityQuery<GlimmerSourceComponent, TransformComponent>().ToList())
{
if (source.Item2.GridUid != Transform(station[0]).GridUid)
Copy link
Contributor

@Mnemotechnician Mnemotechnician Sep 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (source.Item2.GridUid != Transform(station[0]).GridUid)
if (station.All(it => Transform(it).GridUid != source.Item2.GridUid))

var normalSpawnLocations = new List<(VentCritterSpawnLocationComponent, TransformComponent)>();
foreach (var source in EntityQuery<VentCritterSpawnLocationComponent, TransformComponent>().ToList())
{
if (source.Item2.GridUid != Transform(station[0]).GridUid)
Copy link
Contributor

@Mnemotechnician Mnemotechnician Sep 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (source.Item2.GridUid != Transform(station[0]).GridUid)
if (station.All(it => Transform(it).GridUid != source.Item2.GridUid))

var hiddenSpawnLocations = new List<(MidRoundAntagSpawnLocationComponent, TransformComponent)>();
foreach (var source in EntityQuery<MidRoundAntagSpawnLocationComponent, TransformComponent>().ToList())
{
if (source.Item2.GridUid != Transform(station[0]).GridUid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... see above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants