opentibia / server

An open source server for the MMORPG Tibia.
GNU General Public License v2.0
414 stars 149 forks source link

Items/Houses/Depot items/Storage can DISAPPEAR! #57

Open gesior opened 7 years ago

gesior commented 7 years ago

In this 'if': https://github.com/opentibia/server/blob/master/src/database_driver.cpp#L144

You must add:

m_rows++;

or it will remove item/house items on save [there is a little change to remove 1 item - last 'row' of 'insert' query], because:

if(!execute())

2 lines above resets 'm_rows' and used everywhere is sources (ioplayer, iomapserialize):

if(!stmt.execute()){

does nothing, because 'm_rows' is 0.. but there is INSERT QUERY waiting to be send in 'm_buf'!