Character creation process crash fix (world) and query cleanup

This commit is contained in:
akkadius 2014-08-24 07:13:15 -05:00
parent cef1dfd0c0
commit 3b048ee8a2
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 08/24/2014 ==
Akkadius: Character creation process crash fix and query cleanup
== 08/23/2014 ==
Akkadius: Changed zone process window title format, example: 'crushbone :: clients: 6 inst_id: 1 inst_ver: 0 :: port: 7015'
Akkadius: Most of the following changes are QueryServ related, fully implemented its original functionality to be able to offload

View File

@ -608,10 +608,11 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
for (int16 i=EmuConstants::EQUIPMENT_BEGIN; i<=EmuConstants::BANK_BAGS_END;)
{
const ItemInst* newinv = inv->GetItem(i);
if (!newinv)
if (newinv)
{
invquery = StringFormat("INSERT INTO inventory SET charid=%0u, slotid=%0d, itemid=%0u, charges=%0d, color=%0u",
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor());
auto results = QueryDatabase(invquery);
if (!results.RowsAffected())