diff --git a/src/scripts.cc b/src/scripts.cc index 6b6f30b..fcbff25 100644 --- a/src/scripts.cc +++ b/src/scripts.cc @@ -36,6 +36,10 @@ #define SCRIPT_LIST_EXTENT_SIZE 16 +// SFALL: Increase number of message lists for scripted dialogs. +// CE: In Sfall this increase is configurable with `BoostScriptDialogLimit`. +#define SCRIPT_DIALOG_MESSAGE_LIST_CAPACITY 10000 + typedef struct ScriptsListEntry { char name[16]; int local_vars_num; @@ -242,7 +246,7 @@ static Object* gScriptsRequestedStealingBy; static Object* gScriptsRequestedStealingFrom; // 0x6649D4 -static MessageList _script_dialog_msgs[1450]; +static MessageList _script_dialog_msgs[SCRIPT_DIALOG_MESSAGE_LIST_CAPACITY]; // scr.msg // @@ -1494,7 +1498,7 @@ int scriptsInit() return -1; } - for (int index = 0; index < 1450; index++) { + for (int index = 0; index < SCRIPT_DIALOG_MESSAGE_LIST_CAPACITY; index++) { if (!messageListInit(&(_script_dialog_msgs[index]))) { return -1; } @@ -1541,7 +1545,7 @@ int _scr_game_init() return -1; } - for (i = 0; i < 1450; i++) { + for (i = 0; i < SCRIPT_DIALOG_MESSAGE_LIST_CAPACITY; i++) { if (!messageListInit(&(_script_dialog_msgs[i]))) { debugPrint("\nERROR IN SCRIPT_DIALOG_MSGS!"); return -1; @@ -1611,7 +1615,7 @@ int scriptsExit() // 0x4A52F4 int _scr_message_free() { - for (int index = 0; index < 1450; index++) { + for (int index = 0; index < SCRIPT_DIALOG_MESSAGE_LIST_CAPACITY; index++) { MessageList* messageList = &(_script_dialog_msgs[index]); if (messageList->entries_num != 0) { if (!messageListFree(messageList)) {