Core/Players: Fixed worgen character creation

Port From (https://github.com/TrinityCore/TrinityCore/commit/15611810daa19c2fbcccf6a4d8f7ba95d7ff7a06)
This commit is contained in:
hondacrx
2020-12-25 15:47:51 -05:00
parent a65dfbee98
commit 2485ea604d
+11
View File
@@ -180,6 +180,11 @@ namespace Game.DataStorage
}
}
Dictionary<uint, uint> parentRaces = new Dictionary<uint, uint>();
foreach (ChrRacesRecord chrRace in CliDB.ChrRacesStorage.Values)
if (chrRace.UnalteredVisualRaceID != 0)
parentRaces[(uint)chrRace.UnalteredVisualRaceID] = chrRace.Id;
foreach (ChrRaceXChrModelRecord raceModel in CliDB.ChrRaceXChrModelStorage.Values)
{
ChrModelRecord model = CliDB.ChrModelStorage.LookupByKey(raceModel.ChrModelID);
@@ -189,8 +194,14 @@ namespace Game.DataStorage
var customizationOptionsForModel = customizationOptionsByModel.LookupByKey(model.Id);
if (customizationOptionsForModel != null)
{
_chrCustomizationOptionsByRaceAndGender.AddRange(Tuple.Create((byte)raceModel.ChrRacesID, (byte)model.Sex), customizationOptionsForModel);
uint parentRace = parentRaces.LookupByKey(raceModel.ChrRacesID);
if (parentRace != 0)
_chrCustomizationOptionsByRaceAndGender.AddRange(Tuple.Create((byte)parentRace, (byte)model.Sex), customizationOptionsForModel);
}
// link shapeshift displays to race/gender/form
foreach (var shapeshiftOptionsForModel in shapeshiftFormByModel.LookupByKey(model.Id))
{