Repository navigation
feat: prefer tech-applied ship in pinned ship level ties - #335
Open
GingerNinja-STFC wants to merge 5 commits into
Open
GingerNinja-STFC wants to merge 5 commits into
GingerNinja-STFC wants to merge 5 commits into
Conversation
When several same-hull ships tied on level matched one pinned_ships entry, the winner was whichever ship the active sort listed first. Query ForbiddenTechManager (the same path the ship tech indicators use) for the ship's forbidden/chaos tech slots and let the ship with tech applied win the tie. The check is memoized per sort and only runs on actual level ties; bindings are lazily resolved and validated once, degrading to the previous behaviour with a single warning if unavailable. Adds HullId and Ship accessors to the prime FleetPlayerData header.
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.
Summary
When several same-hull ships tied on level matched one
pinned_shipsentry, the winner was previously whichever ship the active sort happened to list first. This change lets the ship with forbidden/chaos tech applied win the tie.How it works
ForbiddenTechManager— the same path the ship tech indicators use — for the ship's forbidden/chaos tech slots, and treats either slot holding an item as "tech applied".ShipEntry::TechApplied(), resolved lazily to-1/0/1) and only runs on actual level ties between same-hull ships, so there's no cost on normal sorts.ForbiddenTechManagersingleton,TryGetActiveForbiddenTechSlot,EntitySlot.get_SlotSpecId/get_SlotItemId,BaseShip.get_Id) are resolved and validated once; if anything is missing, the feature degrades to the previous behaviour with a single warning.HullIdandShipaccessors to the primeFleetPlayerDataheader.Testing
xmake f -p macosx -a arm64 -m debug --target_minver=14.6 -y && xmake -y mods— builds clean.git diff --check— clean.