mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32:45 +03:00
feat(db): generate id fields if needed during record loads
This commit is contained in:
parent
7514b717c9
commit
090cd1dc54
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user