Tradeskill Bug--Quick Fix
I am kind of new to this engine so if what im about to explain has already been covered then my apologies!
A friend and I got together and started a server a couple of weeks ago. While testing everything out we noticed a bug in the tradeskills. If you try to combine a recipe that has the exact same ingredients, but a different container type you get a message: "These items cannot be combined in this container type." Just in case anyone reading doesn't understand the problem, here is an example: There are two recipes: Boots of Justice and Boots of the Northern Wolf. Both of these recipes have the exact same ingredients, the only difference is they use two different containers. If you walk through the TradeSkills.cpp you'll notice what is going on. The code does two checks, first a basic check to find the recipe and if the database returns multiple results it calculates a unique number based on the ingredient id's. This works fine usually, but in the case above, you still get multiple recipes returned because they use the EXACT same ingredients, so instead of validating again, it just returns false thinking you have a duplicate recipe in the table. Ive fixed this by adding in a third check. Now if it returns multiple recipes a second time, we validate the container type and if the player is using the correct container type it will validate properly.(Or return false if the recipe is truely not unique or the correct container isn't being used) Here is the code:(It starts around line 900 in the tradeskills.cpp) Code:
//updated this section to fix the tradeskill bug of multiple recipies, but different containers. Hope it helps someone here... -Nut |
Awesome, that bug has annoyed me for some time! Thanks for the fix, I'll try it out on PEQ the next time it reboots.
|
No problem. Just post back here if you have any problems adding it and ill just post up my entire tradeskills.cpp file.
|
I have found one problem with I think is this piece of code. It looks like it has created a new zone crash. I've never seen it before, and since the only thing that has changed in tradeskills is this, I'm opt to think this is the culprit. It's not a common crash by any means (it has happened a total of 3 times on PEQ, which in the grand scheme of things, considering the amount of players and how often they combine isn't a lot) but it's a crash nonetheless. Here's the debug output:
Code:
#0 0x081a6946 in ZoneDatabase::GetTradeRecipe(ItemInst const*, unsigned char, unsigned, DBTradeskillRecipe_Struct*) (this=0x82c5f20, container=0x83e7c28, |
Sorry for the delay. Ive been moving for a few days, so my internet hasn't been up until today.
Anyway. I find it odd that its crashing the zone server..hmm. I haven't notice any crashes on the build over here. We run a much smaller player base though. Here is the diff: Code:
--- tradeskills.cpp 7 Jun 2007 07:03:46 -0000 1.18 Ill take some time and retrace the code and see if I can find any problems or paths that aren't being handled and see if I can get to the bottom of this. |
Before I move this into the live code, is there any problem with it? Cavedude? Was this the cause oif the zone crash and if so do we have the fix?
|
Quote:
|
Quote:
EDIT: here is a list of what I have in that isn't in that list yet (from the changelog): ==06/19/2008 Scorpious2k (Knightly): Correction of divine intervention text Scorpious2k (LordKahel): Support for defensive Instinct and Reflexive Mastery AA ==06/18/2008 Scorpious2k (Derision): Fix for flee runspeed - linear flee speed reduction as HP drops Scorpious2k (Derision): Rule to prevent mobs from fleeing if they are being helped by other NPCs Scorpious2k (haecz): Distance check for corpse dragging Scorpious2k (haecz): Distance check for taunt Scorpious2k (greggg230): Merchant price faction/charisma fix Scorpious2k (greggg230): Faction will now show on /con for agnostic players Scorpious2k (BatCountry): Correction of a zone crash caused by reloading rules Scorpious2k (Congdar): Eliminated array index error/zone crash in spells ==06/17/2008 Scorpious2k (TheLieka): Ban by IP Scorpious2k (cavedude/TheLieka): Ability to limit melee guys from being bound in certain zones. This changes the canbind column of the zone table. Value 0 means noone can bind, value 1 means only casters can bind, value 2 means anyone can bind in the zone (ie cities). Required SQL: CREATE TABLE `Banned_IPs` ( `ip_address` VARCHAR(32) NOT NULL, PRIMARY KEY (`ip_address`) ) ENGINE = InnoDB; Optional SQL: Insert into rule_values values (0, 'World:UseBannedIPsTable', 0); Update zone set canbind = 2 where zoneidnumber in (1,2,3,8,9,10,19,23,24,29,40,41,42,45,49,52,54,55, 60,61,62,67,75,82,83,106,155); |
All times are GMT -4. The time now is 07:48 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.