Minor bug in IsStackable

Bug reports and feature requests. New features can only be added to the current development version. Bug-fixes may be back-ported.

Current release: 099 / Current development: 100
Post Reply
bodom
POL Developer
Posts: 136
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Minor bug in IsStackable

Post by bodom » Fri May 29, 2015 2:16 pm

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

Toadstool
New User
Posts: 8
Joined: Mon Apr 27, 2015 10:29 pm

Re: Minor bug in IsStackable

Post by Toadstool » Fri May 29, 2015 4:05 pm

No, it's meant to work like that.

bodom
POL Developer
Posts: 136
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Minor bug in IsStackable

Post by bodom » Sat May 30, 2015 10:11 pm

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.

Toadstool
New User
Posts: 8
Joined: Mon Apr 27, 2015 10:29 pm

Re: Minor bug in IsStackable

Post by Toadstool » Mon Jun 01, 2015 3:17 am

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

bodom
POL Developer
Posts: 136
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Minor bug in IsStackable

Post by bodom » Mon Jun 01, 2015 10:32 am

;)

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.

Clash
New User
Posts: 8
Joined: Sun Apr 26, 2015 12:05 pm

Re: Minor bug in IsStackable

Post by Clash » Tue Aug 11, 2015 5:45 pm

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;"

bodom
POL Developer
Posts: 136
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Minor bug in IsStackable

Post by bodom » Sat Aug 15, 2015 2:09 pm

I am sorry, I don't understand what your answer has to do with the topic.

Misclick? :)

Post Reply