summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-05-01 06:21:33 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-05-02 21:42:41 +0200
commit29d40c5a52ab4bb1ef08e03b763bfa47f6cad0fe (patch)
tree263cefaac3bdeabe67fd3f6f9681a706fa5da66e /src/common
parent82e2744a6df3f97d1236c06e7eca4d2a88ab6c0b (diff)
downloadhercules-29d40c5a52ab4bb1ef08e03b763bfa47f6cad0fe.tar.gz
hercules-29d40c5a52ab4bb1ef08e03b763bfa47f6cad0fe.tar.bz2
hercules-29d40c5a52ab4bb1ef08e03b763bfa47f6cad0fe.tar.xz
hercules-29d40c5a52ab4bb1ef08e03b763bfa47f6cad0fe.zip
Add constant for maximum string variable value length
Also add static assert check for SCRIPT_VARNAME_LENGTH
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mmo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 9421f6e35..d2f3aa8f1 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -380,7 +380,10 @@ STATIC_ASSERT(MAX_ITEM_OPTIONS <= 5, "This value is limited by the client and da
#define JOBL_BABY 0x2000
#define JOBL_THIRD 0x4000
-#define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable
+#define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable's name including affixes and excluding NULL-terminator.
+STATIC_ASSERT(SCRIPT_VARNAME_LENGTH <= 32, "This value is limited by the inter-server communication and database layout and should only be increased if you know the consequences.");
+#define SCRIPT_STRING_VAR_LENGTH 255 ///< Maximum length of strings stored in script variables excluding NULL-terminator.
+STATIC_ASSERT(SCRIPT_STRING_VAR_LENGTH <= 255, "This value is limited by the inter-server communication and database layout and should only be increased if you know the consequences.");
#define INFINITE_DURATION (-1) // Infinite duration for status changes