Merchant and status bug fix
Hey guys! Great job on the emu! Anyway, I figured out how to fix the merchant and status bugs. In client_process.cpp line:4269, it delete's cpi, but handyitem isn't done with it yet. On the source I got, I just moved it to line 4299, right after the if statement.
Also, as for the status<128 bug. Status is set to tinyint. Tinyint is only 7 bits so it has a max of 127. You can just change it to an int by typing: ALTER TABLE account MODIFY status int NOT NULL default '0'; Hope that helps. Would love to hear how that works out, email me if ya get a chance. Email should be on profile. :D Laters, Keshik |
Thought I'd clarify what I said.
The bad line is in BulkSendMerchantInventory right after it picks a random item from handyitem. Code looks something like this. APPLAYER* outapp = new APPLAYER(OP_ShopItem, 5000); outapp->size = 2 + DeflatePacket((uchar*) cpi->packets, cpi->count * sizeof(MerchantItemD_Struct), &outapp->pBuffer[2], 5000-2); MerchantItem_Struct* cpi2 = (MerchantItem_Struct*) outapp->pBuffer; cpi2->count = cpi->count; QueuePacket(outapp); //DumpPacket(outapp); //printf("Merchant has %i items available.\n",cpi->count); delete outapp; // delete cpi; << bad line :) handyitem not done with it yet :) Mob* merch = entity_list.GetMob(npcid); if(merch != 0 && handyitem) { ... blah blah blah... } delete cpi; // << good line :) } Hope that clears things up. :) Sorry that post was so confusing. Lack-o-sleep induced insanity. Laters, Keshik |
My database just has the status field unsigned. Did you run the scripts to create the database or did you tinker with it by hand? Mine works fine on a tinyint unsigned.
|
Oops, sorry about that. Just checked, the original db.sql from 3.9 has this in it for the table:
CREATE TABLE account ( id int(11) NOT NULL auto_increment, name varchar(30) NOT NULL default '', charname varchar(64) NOT NULL default '', packencrypt blob NOT NULL default '', password varchar(30) NOT NULL default '', status tinyint(5) NOT NULL default '0', lsaccount_id int(11) unsigned default NULL, gmspeed tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY lsaccount_id (lsaccount_id), UNIQUE KEY name (name) ) TYPE=MyISAM; But the dbupdate.sql file contains: alter table account modify status int(4) not null default '0'; Don't I feel stupid. I thought you only sourced dbupdate.sql if you were upgrading and not completely reinstalling/installing for the first time. Anyways, how did the merchant thing work? I'd love to hear if that worked out. Laters, Keshik |
All times are GMT -4. The time now is 11:42 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.