Fix excess orders stopping other orders' creation#1
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves the "strange bug" with tactical missile / billy nuke and teleport: FAForever#5679
First it wasn't creating the orders because 7 base orders + 3 engineering orders + 1 OC + 2 missile + 1 tele = 14, which is more than the 12 allowed to be created.
After fixing that, there is a bug where orders are created out of all available orders using limited order-assigned slots. This meant that it could grab a
nilslot for an available order, since that order didn't get assigned in the slot checking beforehand. This is fixed with a nil check.Ideally there would be a priority system for what orders are given slots, but that isn't worth the effort given how rarely you select units with enough orders to do that (needs cross-faction, cross-theater, and/or very expensive units).