From 7a0233388a7ca82bd9ce626901cadb526f6e3908 Mon Sep 17 00:00:00 2001 From: HAO YAN Date: Mon, 11 Oct 2021 15:31:24 +0800 Subject: [PATCH] Update getinventorylist - favorite field (#6302) - added favorite field --- doc/script_commands.txt | 1 + src/map/script.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index f845e00a54..60354d9a94 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2955,6 +2955,7 @@ recreate these items perfectly if they are destroyed. Here's what you get: @inventorylist_option_value5[] - fifth array of random option values @inventorylist_option_parameter5[] - fifth array of random option parameters @inventorylist_tradable - Returns if an item is tradable or not (Pass item_trade.txt, bound, and rental restrictions). +@inventorylist_favorite - Returns if an item is favorite or not This could be handy to save/restore a character's inventory, since no other command returns such a complete set of data, and could also be the only way to diff --git a/src/map/script.cpp b/src/map/script.cpp index 4a2ac6f044..1de0aebf5e 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -14381,6 +14381,7 @@ BUILDIN_FUNC(getinventorylist) pc_setreg(sd,reference_uid(add_str(randopt_var), j),sd->inventory.u.items_inventory[i].option[k].param); } pc_setreg(sd,reference_uid(add_str("@inventorylist_tradable"), j),pc_can_trade_item(sd, i)); + pc_setreg(sd,reference_uid(add_str("@inventorylist_favorite"), j),sd->inventory.u.items_inventory[i].favorite); j++; } }