From 870e3d94076c6b72e623099156cc8d91cb4713da Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Wed, 8 Sep 2021 08:27:09 +0200 Subject: [PATCH] Added an error message to openmail (#6243) Fixes #6159 Thanks to @SynchronyMaster --- doc/script_commands.txt | 2 ++ src/map/script.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 8fc4355eef..601efe901b 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5524,6 +5524,8 @@ Example: This will open a character's Mail window on the client connected to the invoking character. +This command is not supported for PACKETVER 20150513 or newer. + mes "Close this window to open your mail inbox."; close2; openmail; diff --git a/src/map/script.cpp b/src/map/script.cpp index 3b79abaf0a..0d0b43fdb2 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -19435,14 +19435,20 @@ BUILDIN_FUNC(warpportal) **/ BUILDIN_FUNC(openmail) { - TBL_PC* sd; + struct map_session_data* sd; if (!script_charid2sd(2,sd)) return SCRIPT_CMD_FAILURE; +#if PACKETVER < 20150513 mail_openmail(sd); return SCRIPT_CMD_SUCCESS; +#else + ShowError( "buildin_openmail: This command is not supported for PACKETVER 2015-05-13 or newer.\n" ); + + return SCRIPT_CMD_FAILURE; +#endif } /**