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

Invalid templates can exist in production in certain edge-cases #3799

Open
Arithyce opened this issue May 10, 2024 · 0 comments
Open

Invalid templates can exist in production in certain edge-cases #3799

Arithyce opened this issue May 10, 2024 · 0 comments
Labels

Comments

@Arithyce
Copy link

Arithyce commented May 10, 2024

Describe the bug
It is possible for invalid templates (such as ones containing unavailable components) to end up in production queues and in the production menu.

When a component is made unavailable, any queued units with that component will remain in the production menu and will only be cleared upon re-opening the menu if there is only 1 queued, otherwise the "ghost" template will remain until unqueued. An error is given when the game attempts to produce the unit:
Machinegun Viper Half-tracks : not researched weapon 0,
Wrong template for player 0 factory, type 1.

To Reproduce
Steps to setup:

  1. Get the latest portable artifact from Allow components/structures to be made unavailable #3785.
  2. Download the attached zip file, change the extension to .wz.
  3. Run the downloaded portable artifact to generate the mod folder then exit the game.
  4. Install the downloaded mod into the portable artifacts mod autoload folder.
  5. Run the portable artifact. Make sure that stats.wz shows in the top left, if not, verify the mod is installed.

Steps to reproduce the behavior:

  1. Start setting up a Skirmish match.
  2. Start with advanced bases and technology level 3, start the match.
  3. Research Neural Synapse Research Brain Mk3.
  4. Design (a) template(s) that contains any of the following: Scourge Missile, Needle Gun, Flashlight.
  5. Queue 9 of any of these templates for production (9 in a single slot).
  6. Research Make Weapons Unavailable.
  7. Open the production menu to see the issues, wait for an invalid template to be produced to see more issues.

Expected behavior
For there to be no invalid templates in production, or to be available for production.

Additional context
This issue stems from #3785.
This issue should be fixed in general instead of handled case-by-case, and should not prevent the above PR from being merged.

Proposed solution
The solution should be able to detect invalid templates in production, and then remove them from production.
This solution should deprecate the deleteTemplateFromProduction() function.
Additionally, this solution would also enhance anti-cheat, circumventing any potential exploits that would allow production of invalid templates.

Mod to reproduce this issue
stats.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant