Skip to content

Commit

Permalink
Core/Players: Fixed worgen character creation
Browse files Browse the repository at this point in the history
Closes #25731
  • Loading branch information
Shauren committed Dec 19, 2020
1 parent ad0fa5a commit 1561181
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/server/game/DataStores/DB2Stores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,14 +974,28 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul
if (ChrCustomizationChoiceEntry const* customizationChoice = sChrCustomizationChoiceStore.LookupEntry(reqChoice->ChrCustomizationChoiceID))
_chrCustomizationRequiredChoices[reqChoice->ChrCustomizationReqID][customizationChoice->ChrCustomizationOptionID].push_back(reqChoice->ChrCustomizationChoiceID);

std::unordered_map<uint32, uint32> parentRaces;
for (ChrRacesEntry const* chrRace : sChrRacesStore)
if (chrRace->UnalteredVisualRaceID)
parentRaces[chrRace->UnalteredVisualRaceID] = chrRace->ID;

for (ChrRaceXChrModelEntry const* raceModel : sChrRaceXChrModelStore)
{
if (ChrModelEntry const* model = sChrModelStore.LookupEntry(raceModel->ChrModelID))
{
_chrModelsByRaceAndGender[{ uint8(raceModel->ChrRacesID), uint8(model->Sex) }] = model;

if (std::vector<ChrCustomizationOptionEntry const*> const* customizationOptionsForModel = Trinity::Containers::MapGetValuePtr(customizationOptionsByModel, model->ID))
_chrCustomizationOptionsByRaceAndGender[{ uint8(raceModel->ChrRacesID), uint8(model->Sex) }] = *customizationOptionsForModel;
{
std::vector<ChrCustomizationOptionEntry const*>& raceOptions = _chrCustomizationOptionsByRaceAndGender[{ uint8(raceModel->ChrRacesID), uint8(model->Sex) }];
raceOptions.insert(raceOptions.end(), customizationOptionsForModel->begin(), customizationOptionsForModel->end());

if (uint32 const* parentRace = Trinity::Containers::MapGetValuePtr(parentRaces, raceModel->ChrRacesID))
{
std::vector<ChrCustomizationOptionEntry const*>& parentRaceOptions = _chrCustomizationOptionsByRaceAndGender[{ uint8(*parentRace), uint8(model->Sex) }];
parentRaceOptions.insert(parentRaceOptions.end(), customizationOptionsForModel->begin(), customizationOptionsForModel->end());
}
}

// link shapeshift displays to race/gender/form
for (std::pair<uint32 const, std::pair<uint32, uint8>> const& shapeshiftOptionsForModel : Trinity::Containers::MapEqualRange(shapeshiftFormByModel, model->ID))
Expand Down

0 comments on commit 1561181

Please sign in to comment.