feat(db): generate id fields if needed during record loads

This commit is contained in:
fallenoak 2025-10-25 22:43:05 -05:00
parent 7514b717c9
commit 090cd1dc54
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D

View File

@ -159,6 +159,10 @@ void WowClientDB<T>::LoadRecords(SFile* f, const char* filename, int32_t linenum
auto record = &this->m_records[i]; auto record = &this->m_records[i];
record->Read(f, this->m_strings); record->Read(f, this->m_strings);
if (T::NeedIDAssigned()) {
record->SetID(i);
}
this->m_maxID = record->GetID() > this->m_maxID ? record->GetID() : this->m_maxID; this->m_maxID = record->GetID() > this->m_maxID ? record->GetID() : this->m_maxID;
this->m_minID = record->GetID() < this->m_minID ? record->GetID() : this->m_minID; this->m_minID = record->GetID() < this->m_minID ? record->GetID() : this->m_minID;
} }