[Dev Rev II] Crafting Gem stack bug (solved)

Put your bugs you find in osRose here

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[Dev Rev II] Crafting Gem stack bug (solved)

Postby kismetbecomes on Thu Mar 29, 2012 2:55 am

Using Dev Rev II.
naRose 307.

and Lmame said this is fixed in dev rev II.
:? This means I'm a lil bit screwed.

CASE:
Crafted a new GEM.
Occupies a slot (of course)
But the next time you craft,
the gem is still [1] even tho
I've crafted many.. all success.
By dropping [1] gem.. the numbers
returns back to its "supposed" number of items crafted.

I guess the problem is that - new items coming
from craft's success overlaps the existing items
in the inventory.

Posted a similar question here: viewtopic.php?f=30&t=3192
*but nobody might have seen it..
Looking forward for your help. Thank you.
Last edited by kismetbecomes on Fri Mar 30, 2012 7:29 am, edited 2 times in total.
RoseZa v437 - HueRose Test Project -- http://hueroseonline.no-ip.biz
kismetbecomes
Rackie
Rackie
 
Posts: 299
Joined: Mon Feb 06, 2012 12:41 am

Re: [Dev Rev II] still getting the stack bug.

Postby Mark on Thu Mar 29, 2012 10:35 am

Ok here's the Fix:

Search in:
bool CWorldServer::pakCraft( CPlayer* thisclient, CPacket* P )

Find:
  1. thisclient->items[newslot] = item;

**Note: There are 3 sections where this code line can be found, upon searching for the above code, the 1st section will be for PAT items, click search again, the next section will be for Quest Items, click search again, the 3rd and final search result will be the section you require to post this code.

Add before the above code
  1. if (item.itemtype>=10&&item.itemtype<=12)
  2. {
  3.     item.count+=thisclient->items[newslot].count;
  4. }


So your Final code looks a little like this:
  1. if (item.itemtype>=10&&item.itemtype<=12)
  2. {
  3.     item.count+=thisclient->items[newslot].count;
  4. }
  5.  
  6. thisclient->items[newslot] = item;


Your going to need to ensure that you have placed the code in the right place, otherwise it will not work.

Any problems, post em here.
Administrator / Coder for EutopiaRose Online
Image
http://www.eutopiarose.co.uk
User avatar
Mark
Rackie
Rackie
 
Posts: 176
Joined: Tue Dec 13, 2011 8:15 am
Location: Sunny England

Re: [Dev Rev II] still getting the stack bug.

Postby kismetbecomes on Thu Mar 29, 2012 12:45 pm

"bool CWorldServer::pakCraft( CPlayer* thisclient, CPacket* P )" is inside worldpackets.cpp right?

*If yes, then the codes are already there.
I think lmame added it himself.


  1.        //LMA: Stackable fix.
  2.         if (item.itemtype>=10&&item.itemtype<=12)
  3.         {
  4.             item.count+=thisclient->items[newslot].count;
  5.         }
  6.  
  7.         thisclient->items[newslot] = item;


Found that inside worldpackets.cpp
It's already there.


And. There is only ONE :
  1. thisclient->items[newslot] = item;
inside that file.

I'm sorry. Maybe I'm just really dumb. I'm not much of a coder.
RoseZa v437 - HueRose Test Project -- http://hueroseonline.no-ip.biz
kismetbecomes
Rackie
Rackie
 
Posts: 299
Joined: Mon Feb 06, 2012 12:41 am

Re: [Dev Rev II] still getting the stack bug.

Postby Mark on Thu Mar 29, 2012 2:17 pm

Ok try this:

Find this:
  1.  
  2. if (item.itemtype == 11)
  3. {
  4. ADDWORD( pak, 0x0001);// amount
  5. ADDWORD( pak, 0x0000);
  6. }
  7. else
  8. {
  9. ADDDWORD(pak, BuildItemData(item));
  10. }
  11.  


Replace with this
  1. ADDDWORD(pak, BuildItemData(item));


So your final code would just look like this:
  1. ADDDWORD(pak, BuildItemData(item));


Nothing else, nothing more.

Again Let me know if this fixes it for you.
Administrator / Coder for EutopiaRose Online
Image
http://www.eutopiarose.co.uk
User avatar
Mark
Rackie
Rackie
 
Posts: 176
Joined: Tue Dec 13, 2011 8:15 am
Location: Sunny England

Re: [Dev Rev II] still getting the stack bug.

Postby kismetbecomes on Thu Mar 29, 2012 3:20 pm

I'm sorry. It didn't.
Do I have to recompile exe stuff or just replace that as is?
coz that's what I kinda did.

Can we - (and by that I mean you :D ) - like
make the new crafted gems not STACK to the existing
items in the inventory? That way the new
items wont overlap. Hope that gives you an idea.

And by the way, my materials can exceed to 10000+..
its supposed to have like 999 only.. right?
RoseZa v437 - HueRose Test Project -- http://hueroseonline.no-ip.biz
kismetbecomes
Rackie
Rackie
 
Posts: 299
Joined: Mon Feb 06, 2012 12:41 am

Re: [Dev Rev II] still getting the stack bug.

Postby Circa on Fri Mar 30, 2012 12:28 am

each time you add code you recompile
Circa
Clown
Clown
 
Posts: 404
Joined: Sun Aug 23, 2009 5:52 am
Location: CA

Re: [Dev Rev II] still getting the stack bug.

Postby kismetbecomes on Fri Mar 30, 2012 3:43 am

Circa wrote:each time you add code you recompile


Oh sorry. Thought I'll simply replace or add codes to cpp files and that's it. :roll:
(I can be very stupid sometimes.) :cry:
RoseZa v437 - HueRose Test Project -- http://hueroseonline.no-ip.biz
kismetbecomes
Rackie
Rackie
 
Posts: 299
Joined: Mon Feb 06, 2012 12:41 am

Re: [Dev Rev II] still getting the stack bug.

Postby kismetbecomes on Fri Mar 30, 2012 3:51 am

Circa wrote:each time you add code you recompile


Circa, if I may clarify it..
Found this code existing in my cpp file. (worldpackets)
(bug still there)
  1.  //LMA: Stackable fix.
  2.         if (item.itemtype>=10&&item.itemtype<=12)
  3.         {
  4.             item.count+=thisclient->items[newslot].count;
  5.         }
  6.  
  7.         thisclient->items[newslot] = item;
  8.  



Mark suggested to replace this:

  1. if (item.itemtype == 11)
  2. {
  3. ADDWORD( pak, 0x0001);// amount
  4. ADDWORD( pak, 0x0000);
  5. }
  6. else
  7. {
  8. ADDDWORD(pak, BuildItemData(item));
  9. }


with this

  1. ADDDWORD(pak, BuildItemData(item));



after doing that..
I'll recompile the cbp server file and make new exe. Right? :(
RoseZa v437 - HueRose Test Project -- http://hueroseonline.no-ip.biz
kismetbecomes
Rackie
Rackie
 
Posts: 299
Joined: Mon Feb 06, 2012 12:41 am

Re: [Dev Rev II] still getting the stack bug.

Postby kismetbecomes on Fri Mar 30, 2012 7:28 am

Mark! :o
Your FIX worked! (the second)
Thanks Man! :D :lol:
RoseZa v437 - HueRose Test Project -- http://hueroseonline.no-ip.biz
kismetbecomes
Rackie
Rackie
 
Posts: 299
Joined: Mon Feb 06, 2012 12:41 am

Re: [Dev Rev II] Crafting Gem stack bug (solved)

Postby Circa on Fri Mar 30, 2012 7:43 am

Just remember when you add new code that you have to recompile it to make the new .exe
Circa
Clown
Clown
 
Posts: 404
Joined: Sun Aug 23, 2009 5:52 am
Location: CA

Next

Return to Bugs

Who is online

Users browsing this forum: No registered users and 8 guests