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: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Problem with stack when moved by the core

Post by xeon »

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?
Yukiko
Distro Developer
Posts: 2825
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 »

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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem with stack when moved by the core

Post by xeon »

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?
Yukiko
Distro Developer
Posts: 2825
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 »

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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem with stack when moved by the core

Post by xeon »

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.
Yukiko
Distro Developer
Posts: 2825
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 »

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).
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem with stack when moved by the core

Post by xeon »

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 ;)
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problem with stack when moved by the core

Post by Tomi »

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