mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-26 22:06:06 +03:00
feat(glue): implement CCharacterCreation::Initialize
This commit is contained in:
parent
f2a253f5ad
commit
58954a9655
@ -132,5 +132,6 @@ void CCharacterComponent::SetRandomFacialFeature(COMPONENT_CONTEXT context) {
|
||||
}
|
||||
|
||||
bool CCharacterComponent::Init(ComponentData* data, const char* a3) {
|
||||
this->m_data = *data;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -19,8 +19,52 @@ TSGrowableArray<uint32_t> CCharacterCreation::m_races;
|
||||
|
||||
void CCharacterCreation::Initialize() {
|
||||
CCharacterCreation::m_charFacing = 0.0;
|
||||
int32_t factionSwitch = 0;
|
||||
CCharacterCreation::m_charCustomizeFrame = nullptr;
|
||||
CCharacterCreation::m_existingCharacterIndex = -1;
|
||||
// TODO: memset
|
||||
int32_t factionSwitch2 = 0;
|
||||
|
||||
bool weirdCondition = false;
|
||||
|
||||
do
|
||||
{
|
||||
for (int32_t raceIndex = 0; raceIndex < g_chrRacesDB.GetNumRecords(); ++raceIndex)
|
||||
{
|
||||
auto raceRecord = g_chrRacesDB.GetRecordByIndex(raceIndex);
|
||||
if (!raceRecord || (raceRecord->m_flags & 1) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto factionTemplateRecord = g_factionTemplateDB.GetRecord(raceRecord->m_factionID);
|
||||
if (!factionTemplateRecord) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int32_t factionGroupIndex = 0; factionGroupIndex < g_factionGroupDB.GetNumRecords(); ++factionGroupIndex) {
|
||||
auto factionGroupRecord = g_factionGroupDB.GetRecordByIndex(factionGroupIndex);
|
||||
if (!factionGroupRecord || factionGroupRecord->m_maskID == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((1 << factionGroupRecord->m_maskID) & factionTemplateRecord->m_factionGroup) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SStrCmpI(factionGroupRecord->m_internalName, factionSwitch == 1 ? "Horde" : "Alliance", STORM_MAX_STR)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t raceID = raceRecord->m_ID;
|
||||
CCharacterCreation::m_races.Add(1, &raceID);
|
||||
|
||||
factionSwitch = factionSwitch2;
|
||||
}
|
||||
}
|
||||
|
||||
weirdCondition = factionSwitch++ == -1;
|
||||
factionSwitch2 = factionSwitch;
|
||||
} while (weirdCondition || factionSwitch == 1);
|
||||
}
|
||||
|
||||
void CCharacterCreation::SetCharCustomizeFrame(CSimpleModel* frame) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user