Page 1 of 1

Minor bug in IsStackable

Posted: Fri May 29, 2015 2:16 pm
by bodom
Hi there,

I've not tested this directly in 099, but it is present in 098 and I don't see the "fixed" message in the 099 changelog. Hope that's enough.

If i use ReserveItem() on an item, then IsStackable() will always return false if that item is part of the arguments.

Example:

Code: Select all

var a := CreateItem(<create a stackable item>)
var b := CreateItem(<create a stackable item>)

ReserveItem(a);

IsStackable(a, b); // This is now false
Example2:

Code: Select all

var a := CreateItem(<create a stackable item>)
var b := CreateItem(<create a stackable item>)

IsStackable(a, b); // This is now most probably true
I would expect IsStackable() to ignore "reserved" flag if it is set by the current script.

My 2c

Re: Minor bug in IsStackable

Posted: Fri May 29, 2015 4:05 pm
by Toadstool
No, it's meant to work like that.

Re: Minor bug in IsStackable

Posted: Sat May 30, 2015 10:11 pm
by bodom
Are you sure? That doesn't make much sense to me: the expected effect of ReserveItem() is to increase the success rate of item manipulation functions on that item, not to block them.

Re: Minor bug in IsStackable

Posted: Mon Jun 01, 2015 3:17 am
by Toadstool
bodom wrote:Are you sure? That doesn't make much sense to me: the expected effect of ReserveItem() is to increase the success rate of item manipulation functions on that item, not to block them.
Hmmmm :P

Now when I think about it more I suppose you are right!

ReserveItem is meant to make an item only manipulable by THAT script.

Since IsStackable is being called from that script then logic says it should be able to do with it as it pleases.

Fair call by you sir!

Out of interest, when are you using IsStackable for a reserved item? I can't think of any scenario I would have, anything interesting? :P

Re: Minor bug in IsStackable

Posted: Mon Jun 01, 2015 10:32 am
by bodom
;)

I have a sort of "put some order in the backpack" script that reserves item then checks if they can be stacked with something. It is very basic by now, but I am planning to widely improve it.

Re: Minor bug in IsStackable

Posted: Tue Aug 11, 2015 5:45 pm
by Clash
How we did it in zulu hotel valhalla is:
"Get the item ID, for example 0x14fb is Lock picks. So to add lock picks to the file, go to the SetTrueType function and add the following, changing the obtype: elseif( the_item.objtype == 0x14fb ) //Lockpicks
return 0;"

Re: Minor bug in IsStackable

Posted: Sat Aug 15, 2015 2:09 pm
by bodom
I am sorry, I don't understand what your answer has to do with the topic.

Misclick? :)