SRL Archive - Reflection Development

BankContains


HyperSecret

2009-07-02 09:16:51

So I was getting bad results with BankContains for yew logs and I knew that they were there. So I took a look at the BankContains function.

My Yew Logs were in the first bank slot [Index := 0]. BankContains is


2 : if BS.Index > 0 then
Result := SmartGetFieldInt(ItemObj, BankItemIndex) = BS.Index;

Should be changed to


2 : if BS.Index >= 0 then
Result := SmartGetFieldInt(ItemObj, BankItemIndex) = BS.Index;

Or possibly even


2 : Result := SmartGetFieldInt(ItemObj, BankItemIndex) = BS.Index;

I don't know much about the development with these SmartGetField stuff, so I don't know if the last suggestion would work the way it is suppose to, but Having it be BS.Index > 0 doesn't account for the first bank position.

ZephyrsFury

2009-07-02 11:31:03

I believe the 'if BS.Index > 0 then' is there to allow the user to not specify an index.

Gu3st...

2009-07-02 14:46:53

Does it work as you wanted when you put
2 : if BS.Index >= 0 then
Result := SmartGetFieldInt(ItemObj, BankItemIndex) = BS.Index;