From 29d40c5a52ab4bb1ef08e03b763bfa47f6cad0fe Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Fri, 1 May 2020 06:21:33 +0200 Subject: Add constant for maximum string variable value length Also add static assert check for SCRIPT_VARNAME_LENGTH --- src/common/mmo.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/common') 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 -- cgit v1.2.3-60-g2f50