fix(rendering): filter player hair geosets via CharHairGeosets.dbc

buildDefaultPlayerGeosets() was inserting all submeshIds 0-99 into
activeGeosets, showing every hair variation simultaneously. Now uses
the hairGeosetMap_ (from CharHairGeosets.dbc) to select only the
correct hair scalp geoset for the player's race/sex/style, matching
the existing NPC geoset filtering logic in EntitySpawner.
This commit is contained in:
Kelsi 2026-04-03 22:43:37 -07:00
parent 5468a93f2e
commit f79395788a
3 changed files with 62 additions and 11 deletions

View file

@ -3707,14 +3707,18 @@ void Application::spawnPlayerCharacter() {
// Build default geosets for the active character via AppearanceComposer
uint8_t hairStyleId = 0;
uint8_t facialId = 0;
uint8_t raceId = 0;
uint8_t sexId = 0;
if (gameHandler) {
if (const game::Character* ch = gameHandler->getActiveCharacter()) {
hairStyleId = static_cast<uint8_t>((ch->appearanceBytes >> 16) & 0xFF);
facialId = ch->facialFeatures;
raceId = static_cast<uint8_t>(ch->race);
sexId = static_cast<uint8_t>(ch->gender);
}
}
auto activeGeosets = appearanceComposer_
? appearanceComposer_->buildDefaultPlayerGeosets(hairStyleId, facialId)
? appearanceComposer_->buildDefaultPlayerGeosets(raceId, sexId, hairStyleId, facialId)
: std::unordered_set<uint16_t>{};
charRenderer->setActiveGeosets(instanceId, activeGeosets);