From 912bbffb23c385178b3d831b58deb76103bac322 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Dec 2018 05:14:33 +0300 Subject: Add packet CZ_CAMERA_INFO This will allow use client command: /viewpointvalue - show/hide camera information /setcamera range rotation latitude - same with @camerainfo --- src/map/clif.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index e9c69257b..fd3c01168 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -22148,6 +22148,21 @@ static void clif_camera_change(struct map_session_data *sd, float range, float r #endif } +static void clif_parse_cameraInfo(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_cameraInfo(int fd, struct map_session_data *sd) +{ +#if PACKETVER >= 20160525 + const struct PACKET_CZ_CAMERA_INFO *const p = RFIFOP(fd, 0); + char command[100]; + if (p->action == 1) { + sprintf(command, "%ccamerainfo", atcommand->at_symbol); + } else { + sprintf(command, "%ccamerainfo %15f %15f %15f", atcommand->at_symbol, p->range, p->rotation, p->latitude); + } + atcommand->exec(fd, sd, command, true); +#endif +} + // show item preview in already opened preview window static void clif_item_preview(struct map_session_data *sd, int n) { @@ -23361,6 +23376,7 @@ void clif_defaults(void) clif->camera_showWindow = clif_camera_showWindow; clif->camera_change = clif_camera_change; + clif->pCameraInfo = clif_parse_cameraInfo; clif->item_preview = clif_item_preview; clif->enchant_equipment = clif_enchant_equipment; -- cgit v1.2.3-60-g2f50