Skip to content

Fix #27: Discover pawnkinds via defaultFactionDef#55

Open
feldoh wants to merge 1 commit into
mainfrom
fix/27-pawnkind-discovery
Open

Fix #27: Discover pawnkinds via defaultFactionDef#55
feldoh wants to merge 1 commit into
mainfrom
fix/27-pawnkind-discovery

Conversation

@feldoh
Copy link
Copy Markdown
Owner

@feldoh feldoh commented Apr 12, 2026

Summary

  • Adds a one-time cached lookup of PawnKindDef.defaultFactionDef in DefCache.ScanDefs(), piggy-backing on the existing DefDatabase<PawnKindDef> loop (zero extra iterations)
  • Merges discovered kinds into both Extensions.GetKindDefs() and FactionEdit.GetAllPawnKinds()
  • HashSet deduplication prevents duplicates when a kind appears in both pawnGroupMakers and defaultFactionDef
  • VEF Settlers' Bandit-unique pawnkinds (Outlaw, Bandit, Bandit Leader) should now appear in the TC editor

Test plan

  • Load with VEF Settlers installed
  • Open Total Control, add Bandits (SettlerSavage) faction
  • Verify that Outlaw, Bandit, and Bandit Leader pawnkinds appear in the list
  • Verify existing factions still show the same pawnkinds as before (no regressions)

Closes #27

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

PawnKinds where defaultFactionDef points at a faction (e.g. VEF Settlers
Bandit kinds) were not discoverable in the TC UI. Build a
DefaultFactionKinds lookup in DefCache.ScanDefs() and consult it in both
GetKindDefs() and GetAllPawnKinds() so these kinds appear alongside
those found via pawnGroupMakers, fixedLeaderKinds, and basicMemberKind.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to edit pawnkinds unique to VEF: Settlers' Bandit faction

1 participant