You could create a new character and then look at the inventory entry in the database before clicking enter world. At least you could verify what the initial
save value is. EDIT: Another thing to look at is how SummonItem modifies its charges: Code:
ItemInst* inst = database.CreateItem(item, charges); |
There are already provisions for it in most places, but the loss occurs in Database::StoreCharacter(), which is called right after starting items are populated.
The charges field in the inventory table is unsigned and the item charges are written without any testing. Code:
MakeAnyLenString |
Quote:
Your assumption that "I think it's cleaner" is incorrect. I looked at my requirements and considered the options available. I chose the option that satisfied my requirements and was both simple and pragmatic. Quote:
|
Necro!
I came across this issue again and the following code now works as a work-around. Code:
i->PutItem( i->FindFreeSlot(0,0), *pDB->CreateBaseItem( pDB->GetItem( YOUR_ITEM_ID ), 0 ) ); |
I'm looking at the current code in SharedDatabase::SetStartingItems, and it does call CreateBaseItem.
The code you posted has a memory leak since the ItemInst* returned from CreateBaseItem is never deleted. |
Good catch, thank you!
|
All times are GMT -4. The time now is 01:22 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.