diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-10-17 23:11:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-10-22 01:42:43 +0300 |
commit | bf5b2da6f9a395e280c5806456cfe3f7ccf3aaa6 (patch) | |
tree | 12d88f7ca0cf846b2e1cec987b3e3117b442a057 /src/map/clif.c | |
parent | 152e4ee83f5637a25c1e7adb13d34cd10a4686d4 (diff) | |
download | hercules-bf5b2da6f9a395e280c5806456cfe3f7ccf3aaa6.tar.gz hercules-bf5b2da6f9a395e280c5806456cfe3f7ccf3aaa6.tar.bz2 hercules-bf5b2da6f9a395e280c5806456cfe3f7ccf3aaa6.tar.xz hercules-bf5b2da6f9a395e280c5806456cfe3f7ccf3aaa6.zip |
Add packet ZC_ITEM_PREVIEW.
It allow show item preview in already opened preview window.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index ab1e88ffc..62b9a4ca9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21961,6 +21961,26 @@ static void clif_camera_change(struct map_session_data *sd, float range, float r #endif } +// show item preview in already opened preview window +static void clif_item_preview(struct map_session_data *sd, int n) +{ +#if PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) + nullpo_retv(sd); + Assert_retv(n >= 0 && n < MAX_INVENTORY); + + struct PACKET_ZC_ITEM_PREVIEW p; + p.packetType = itemPreview; + p.index = n + 2; +#if PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 + p.isDamaged = (sd->status.inventory[n].attribute & ATTR_BROKEN) != 0 ? 1 : 0; +#endif + p.refiningLevel = sd->status.inventory[n].refine; + clif->addcards(&p.slot, &sd->status.inventory[n]); + clif->add_item_options(&p.option_data[0], &sd->status.inventory[n]); + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -23127,6 +23147,7 @@ void clif_defaults(void) clif->camera_showWindow = clif_camera_showWindow; clif->camera_change = clif_camera_change; + clif->item_preview = clif_item_preview; // -- Pet Evolution clif->pPetEvolution = clif_parse_pet_evolution; |