summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-12-16 05:14:33 +0300
committerAndrei Karas <akaras@inbox.ru>2018-12-16 06:20:36 +0300
commit912bbffb23c385178b3d831b58deb76103bac322 (patch)
tree4fc0aa6d4c2da5629d9ee2258f5fe6887e997866 /src/map/clif.c
parenta0f8fc8cd4a4bd6e245848835db2775596b9362f (diff)
downloadhercules-912bbffb23c385178b3d831b58deb76103bac322.tar.gz
hercules-912bbffb23c385178b3d831b58deb76103bac322.tar.bz2
hercules-912bbffb23c385178b3d831b58deb76103bac322.tar.xz
hercules-912bbffb23c385178b3d831b58deb76103bac322.zip
Add packet CZ_CAMERA_INFO
This will allow use client command: /viewpointvalue - show/hide camera information /setcamera range rotation latitude - same with @camerainfo
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c16
1 files changed, 16 insertions, 0 deletions
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;