Problem with stack when moved by the core

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 096.
Note: Core 096 is no longer officially supported.

Moderator: POL Developer

Post Reply
xeon
Forum Regular
Posts: 333
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy
Contact:

Problem with stack when moved by the core

Post by xeon » Fri Feb 19, 2010 1:23 am

I got a problem with the stack when they are moved by the core (e.g., sold by a vendor), and I think it's a bug in the 096 core.

Suppose I got a stack of an item in the backpack. This item has some CProp, which are NOT part of the "stacking.cfg" cprop.

Now, suppose I buy the same item (objtype) from a vendor. This item has not the CProp of the item in my backpack.

But here's the problem: that item is stacked with the others.

I see that canInsert() receive a request to stack (btw, the "adding_item" is valorized), and after onInsert() (here, "adding_item" is NOT valorized).

Some suggestion? Is really a bug of the 096?
Scripter Xeon | Zulu Hotel Italia 7th Age | www.zhi.it
Image

Yukiko
Distro Developer
Posts: 2525
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Problem with stack when moved by the core

Post by Yukiko » Fri Feb 19, 2010 4:45 am

Could be though I don't remember seeing it. One way to find out is to upgrade to a current core. I am pretty sure the developers aren't fixing bugs in 0.96 any longer.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

xeon
Forum Regular
Posts: 333
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy
Contact:

Re: Problem with stack when moved by the core

Post by xeon » Fri Feb 19, 2010 7:25 am

Eh, I know we should upgrade. We will do it soon.

In the meantime, apart from checking manually the conditions in the canInsert() script, isn't anywhere some configuration to tell the POL how to handle correctly this situation?
Scripter Xeon | Zulu Hotel Italia 7th Age | www.zhi.it
Image

Yukiko
Distro Developer
Posts: 2525
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Problem with stack when moved by the core

Post by Yukiko » Fri Feb 19, 2010 2:09 pm

I don't think there's a way to tell POL 0.96 how to handle joining stacks of items with different CProps. I remember in POL 0.95 you couldn't even stack them at all if the CProps were different. You could have the OnInsert script do a check of the items being moved to a container to see if they have different CProps and then return an error if there was a difference. I don't know how you can initiate a core or script move and tell POL to create a new stack. It seems to always want to merge a stack of a particular objtype being moved to an existing stack if it exists in a container. If I'm wrong then hopefully someone will point that out.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

xeon
Forum Regular
Posts: 333
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy
Contact:

Re: Problem with stack when moved by the core

Post by xeon » Mon Feb 22, 2010 1:18 am

Thank you Yukiko. I am modifying the canInsert() in the way you've suggested, checking in it if CProps between items are different.

This isn't very elegant, and a little heavy for the core, but I can't find another solution.
Scripter Xeon | Zulu Hotel Italia 7th Age | www.zhi.it
Image

Yukiko
Distro Developer
Posts: 2525
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Problem with stack when moved by the core

Post by Yukiko » Mon Feb 22, 2010 4:18 am

You can use the uo.em function GetObjPropertyNames to get a list of the CProps attached to the two different stacks. It returns an aray of type string containing the CProp names. Then it's s simple matter of comparing the lists of names to look for a match (or mismatch).
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

xeon
Forum Regular
Posts: 333
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy
Contact:

Re: Problem with stack when moved by the core

Post by xeon » Mon Feb 22, 2010 5:15 am

Yukiko wrote:You can use the uo.em function GetObjPropertyNames to get a list of the CProps attached to the two different stacks. It returns an aray of type string containing the CProp names. Then it's s simple matter of comparing the lists of names to look for a match (or mismatch).
Yes, I already know that function, anyway thank ;)
Scripter Xeon | Zulu Hotel Italia 7th Age | www.zhi.it
Image

Tomi
POL Developer
Posts: 475
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problem with stack when moved by the core

Post by Tomi » Tue Feb 23, 2010 1:12 pm

And when you feel like upgrading Core 098.2 has it fixed

07-20-2009 MuadDib:
Fixed: Item::Facing updates were no longer updating surrounding clients.
Fixed: Bug with stackables where graphic and crops may be different, still allowing to combine stack (of same objtype)

Post Reply