Jump to content

Recommended Posts

Posted

Hi,

so I already had that suggestion in the past : http://rathena.org/board/topic/59194-upgrade-checkweight/page__p__79979#entry79979" but I feel it was refused, well Kenpachi didn't look that interested. Nethertheless I'll retry a last time cause I feel he didn't get my point or just didn't want to bother core dev.

1st Here the diff for easier explanation : http://upaste.me/b38515856bea1995

(yes I know label are useless here etc doesn't matter)

So right now the issue is that checkweight only return true or false for chekcking space for a new item. That small return prevent to chain check like for say :

chekweight(517,500) && checkweight(516,500) <=> test 17

right now the && check will return true and true wich is true but doesn't check the total weight of both.

But that not all it also prevent slot amount check, <=> test 19.

32K overamount could also be fooled even if this one should be rare <=> test 22

Now I'm sure we may do a NPC function to fix those chaintest (I was originally planning to do so to demonstrate in the test npc), but doing so ain't the good way looking it imo :

1 - chekweight is meant to check if you have enough place in inventory so it would be change like a sub ? or even not used at all ?

2 - chekking via NPC will always be slower, just think of all the pushint, getnum, rechek if sd, recalculate slot etc when we already have all that.

3 - only bad point that I see is that is complexify a bit the chekweight command.

nb : by doing the npc I originally wrote .@succes += ChkResult().. but this failed so we may have a little issue on this.

Posted

This suggestion is for checkweight to accept multiple sets of <item>,<amt> right?

checkweight(<item1>,<amt1>, <item2>,<amt2>, <item3>,<amt3>)

I vote yes!

XD I asked him that, and he said no I believe. Ind understood what he was saying. I agree with this though, Brian, and I liked this idea.

  • Upvote 1
Posted

Ah sorry Cookie I tought I missunderstood, but if you look the diff you'll see that I'm checking for multiple item at once.

I was trying to say it's mean to fix check for multiple item without chaining them with if. Those if that currently won't work unless you rewrite a whole NPC function.

Question and little leak here is how many argument could be pass to a script, right now I'm taking as mush as I can and check if it's a pair but a array ref would be better to increase the nb of item that could be checked.

Posted

For examples of script commands that accept multiple pairs of arguments, there's:

isequipped, isequippedcnt,

npcshopitem, npcshopadditem, npcshopdelitem

Posted

Didn't get exacly what you wanted I check there, those command read it just like I do without really checking the lenght of the list, well we do lastdata wich give us the lenght cheking if it's pair and that all.

Anyway I did a small other version with array, wich imo I found more usefull. I didn't integrate this one with the previous checkweight as he may complicate it a bit.

http://upaste.me/f6491597e6d952ad

all 32 tests succed.

Posted

So, with Ind's response, I'd say we're all in favor of implementation as long as it doesn't remove the current functionality of checkweight (as Ind mentioned in IRC). I mean, that's pretty much of all us voting in favor.

  • Upvote 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...