Fix getnameditem command (#5807)

* Fixes #5713.
* Resolves script command getnameditem not properly naming items.
* Also resolves atcommand getring.
Thanks to @Erukanu and @Balferian!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Balfear 2021-03-31 02:46:31 +03:00 committed by GitHub
parent 1037a75bef
commit b41043d393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -0,0 +1,4 @@
UPDATE `inventory` SET `card2` = `card2` & 65535 WHERE `card0` = 254 OR `card0` = 255;
UPDATE `cart_inventory` SET `card2` = `card2` & 65535 WHERE `card0` = 254 OR `card0` = 255;
UPDATE `storage` SET `card2` = `card2` & 65535 WHERE `card0` = 254 OR `card0` = 255;
UPDATE `guild_storage` SET `card2` = `card2` & 65535 WHERE `card0` = 254 OR `card0` = 255;

View File

@ -6028,8 +6028,8 @@ void getring (struct map_session_data* sd)
item_tmp.nameid = item_id;
item_tmp.identify = 1;
item_tmp.card[0] = CARD0_FORGE;
item_tmp.card[2] = sd->status.partner_id;
item_tmp.card[3] = sd->status.partner_id >> 16;
item_tmp.card[2] = GetWord(sd->status.partner_id,0);
item_tmp.card[3] = GetWord(sd->status.partner_id,1);
if((flag = pc_additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
clif_additem(sd,0,0,flag);

View File

@ -7834,8 +7834,8 @@ BUILDIN_FUNC(getnameditem)
item_tmp.amount=1;
item_tmp.identify=1;
item_tmp.card[0]=CARD0_CREATE; //we don't use 255! because for example SIGNED WEAPON shouldn't get TOP10 BS Fame bonus [Lupus]
item_tmp.card[2]=tsd->status.char_id;
item_tmp.card[3]=tsd->status.char_id >> 16;
item_tmp.card[2]=GetWord(tsd->status.char_id,0);
item_tmp.card[3]=GetWord(tsd->status.char_id,1);
if(pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT)) {
script_pushint(st,0);
return SCRIPT_CMD_SUCCESS; //Failed to add item, we will not drop if they don't fit