Issue Information
-
#005529
-
2 - Fair
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
Originally posted by xRaisen
Hi,
I discovered this by the time I use this code in the script:
When I examined the error and debug it, it shows that its giving a negative value. Im not sure if this a bug, but in the line 5931, I change this code
into this
I removed the negative and it works well.
EDIT: FIXED! I found this! http://rathena.org/b...6528#entry96528 you may now revert it to its original form again
Hi,
I discovered this by the time I use this code in the script:
rentitem groupranditem(IG_group_item),86400;
When I examined the error and debug it, it shows that its giving a negative value. Im not sure if this a bug, but in the line 5931, I change this code
script_pushint(st,-itemdb_searchrandomid(group));
into this
script_pushint(st,itemdb_searchrandomid(group));
I removed the negative and it works well.
EDIT: FIXED! I found this! http://rathena.org/b...6528#entry96528 you may now revert it to its original form again
Originally posted by Epoque
You are indeed correct, odd little piece of code, I have no idea why it was like that. Fixed in [rev='15822'].
You are indeed correct, odd little piece of code, I have no idea why it was like that. Fixed in [rev='15822'].
Originally posted by Ind
indeed old code thing which should be replaced with something cleaner, it was like that because of getitem's way to make a obb/opb item to drop undentified,
indeed old code thing which should be replaced with something cleaner, it was like that because of getitem's way to make a obb/opb item to drop undentified,
//Violet Box, Blue Box, etc - random item pick if( nameid < 0 ) { nameid = -nameid; flag = 1; }this code is now broken however.
Originally posted by Epoque
Indeed. grouprandomitem; returns negative for the getitem; script command, to signal an unidentified item. It definitely does need replacing though with a newer code, potentially a separate script command to directly retrieve an item from a group, rather than rely on the passing of an item id.
Something like getrandomitem <groupid>, <amount>; ?
Indeed. grouprandomitem; returns negative for the getitem; script command, to signal an unidentified item. It definitely does need replacing though with a newer code, potentially a separate script command to directly retrieve an item from a group, rather than rely on the passing of an item id.
Something like getrandomitem <groupid>, <amount>; ?
Originally posted by xRaisen
Yes, it does make the item unidentified. So now I know why its negative. And that code above is now broken indeed but it doesn't produces a damaging effect though.
Maybe, adding an abs() function to the scripting feature might solve it. I think its just a short line of a code that whatever negative integer value is pass, it will return positive.
Furthermore, it will add flexibility to the scripting world of fun.
Yes, it does make the item unidentified. So now I know why its negative. And that code above is now broken indeed but it doesn't produces a damaging effect though.
Maybe, adding an abs() function to the scripting feature might solve it. I think its just a short line of a code that whatever negative integer value is pass, it will return positive.
Furthermore, it will add flexibility to the scripting world of fun.
Edited by xRaisen, 02 April 2012 - 10:37 PM.
Originally posted by Ind
we need a new design for this
we need a new design for this
Originally posted by Ind
Added new design in [rev=16752], need DB developers to replace the existent code all item dbs use with the new one
Added new design in [rev=16752], need DB developers to replace the existent code all item dbs use with the new one
Originally posted by Kenpachi
I don't get the point here. What exactly should be done?
Is GroupRandItem() outdated now? If yes, why exactly and why wasn't it removed? oO
I don't get the point here. What exactly should be done?
Is GroupRandItem() outdated now? If yes, why exactly and why wasn't it removed? oO
Originally posted by EvilPuncker
because of backward compatibility I suppose? until you guys update all item_db entries
because of backward compatibility I suppose? until you guys update all item_db entries
Originally posted by Ind
besides backward compatibility GroupRandItem still have some uses (e.g. the report starter's one), this function is meant for use of the official items that use the "getitem GroupRandItem(group),1;" stuff.
e.g.
besides backward compatibility GroupRandItem still have some uses (e.g. the report starter's one), this function is meant for use of the official items that use the "getitem GroupRandItem(group),1;" stuff.
e.g.
getitem groupranditem(IG_BlueBox),1;should become
getrandgroupitem IG_BlueBox,1;
Originally posted by mkbu95
Fixed in [rev=16932].
Fixed in [rev=16932].