Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix for RA2 Mod: cloning vats #17434
This fix will allow cloning vats in the RA2 mod to work correctly.
The RA2 mod currently has a bug where the cloning vats don't work. This is because they're set to have a production type of Dummy, so that they can produce units. However there is a check in the OpenRA engine prevents new units of only the same type being produced. Because cloning vats should not be able to allow the construction of new units (you need a barracks to do this), it's set to a fake Dummy type.
I was tempted to rip out the check altogether, however I'm unsure if other mods have buildings that use the cloning feature.
I've pulled the check out of the main function into its own function for readability.
This is entirely wrong on principle.
The actual issue why the Vats break is #17396 (which this doesn't fix currently) and should be considered as a few-line fix - you need to add a
You can also look at https://github.com/AttacqueSuperior/ValiantHearts/blob/master/mods/ra2vh/rules/soviet-structures.yaml#L578 to see how should the YAML look like when this is fixed in the proper method.
Thanks for your feedback. @GraionDilach I've rewritten the patch so it uses ProductionType instead.
I've tested it with the following yml and it works as expected: