[DiscordArchive] I might remember wrong, but isnt item guid also only generated on even numbers?
[DiscordArchive] I might remember wrong, but isnt item guid also only generated on even numbers?
Archived author: Kitzunu • Posted: 2025-02-16T12:24:13.969000+00:00
Original source
wow
Archived author: Kitzunu • Posted: 2025-02-16T12:42:21.659000+00:00
Original source
Could we potentially create issues if we were to delete the temp item in db before we delete pItem?
Archived author: walkline • Posted: 2025-02-16T12:50:08.569000+00:00
Original source
I don't think a temp item would ever be stored in the db
Archived author: Kitzunu • Posted: 2025-02-16T12:50:52.886000+00:00
Original source
oh I see what you are saying, the guid counter on item create doesnt check db but has some internal counter?
Archived author: Kitzunu • Posted: 2025-02-16T12:51:12.946000+00:00
Original source
I just checked that function and it outputs
```
pItem->GetGUID() 33
pItem->GetGUID() 35
pItem->GetGUID() 37
pItem->GetGUID() 39
pItem->GetGUID() 41
pItem->GetGUID() 43
pItem->GetGUID() 45
pItem->GetGUID() 47
```
which is db guid -1
Archived author: walkline • Posted: 2025-02-16T12:54:34.724000+00:00
Original source
Yeah, we are not directly interacting with the db during item creation. We just using this guid counter - https://github.com/azerothcore/azerothco...#L295-L308
Archived author: Kitzunu • Posted: 2025-02-16T12:55:04.446000+00:00
Original source
yeah that was what I was getting at
Archived author: Kitzunu • Posted: 2025-02-16T12:55:06.174000+00:00
Original source
hmm
Archived author: Kitzunu • Posted: 2025-02-16T12:58:15.385000+00:00
Original source
and the guid counter is found here
```cpp
result = CharacterDatabase.Query("SELECT MAX(guid) FROM item_instance");
if (result)
GetGuidSequenceGenerator<HighGuid::Item>().Set((*result)[0].Get<uint32>() + 1);
```
So it will always run from max and never fill gaps
Archived author: Kitzunu • Posted: 2025-02-16T12:58:17.832000+00:00
Original source
interesting