Page 1 of 1

Problem with stack when moved by the core

Posted: Fri Feb 19, 2010 1:23 am
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?

Re: Problem with stack when moved by the core

Posted: Fri Feb 19, 2010 4:45 am
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.

Re: Problem with stack when moved by the core

Posted: Fri Feb 19, 2010 7:25 am
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?

Re: Problem with stack when moved by the core

Posted: Fri Feb 19, 2010 2:09 pm
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.

Re: Problem with stack when moved by the core

Posted: Mon Feb 22, 2010 1:18 am
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.

Re: Problem with stack when moved by the core

Posted: Mon Feb 22, 2010 4:18 am
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).

Re: Problem with stack when moved by the core

Posted: Mon Feb 22, 2010 5:15 am
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 ;)

Re: Problem with stack when moved by the core

Posted: Tue Feb 23, 2010 1:12 pm
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)