mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-06 22:59:53 +03:00
feat(db): generate id fields if needed during record loads
This commit is contained in:
1 file changed
+4
@@ -159,6 +159,10 @@ void WowClientDB<T>::LoadRecords(SFile* f, const char* filename, int32_t linenum
|
||||
auto record = &this->m_records[i];
|
||||
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_minID = record->GetID() < this->m_minID ? record->GetID() : this->m_minID;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user