View Single Post
  #3  
Old 11-27-2012, 05:13 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 269
Default

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
            (
                &invquery,
                "INSERT INTO inventory SET "
                "charid=%0u, slotid=%0d, itemid=%0u, charges=%0d, color=%0u",
                charid, i, newinv->GetItem()->ID,
                newinv->GetCharges(), newinv->GetColor()
            );
Reply With Quote