database: Set an item's ID before reading it in

Tracks need to know their own ID to set up filtering properly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-06-04 13:23:50 -04:00
parent 72a51fb78f
commit 2f1d7a73ce
1 changed files with 1 additions and 1 deletions

View File

@ -67,8 +67,8 @@ void Database<T> :: load()
_db[i] = NULL;
else {
_db[i] = new T;
_db[i]->read(_file);
_db[i]->id = i;
_db[i]->read(_file);
_keys[_db[i]->primary_key()] = i;
_size++;
}