# HG changeset patch # User Jonathan G Rennison # Date 2024-01-04 01:51:40 # Node ID 22113f00c2f2d860cbd7800bdf84cf7afd30c4a4 # Parent a6dea280bbeb09687bd644d67e128cd729d4bfab Change: Allow STRING/STRINGN to use all remaining parameters in game script mode diff --git a/src/strings.cpp b/src/strings.cpp --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1118,7 +1118,7 @@ static void FormatString(StringBuilder & StringID string_id = args.GetNextParameter(); if (game_script && GetStringTab(string_id) != TEXT_TAB_GAMESCRIPT_START) break; /* It's prohibited for the included string to consume any arguments. */ - StringParameters tmp_params(args, 0); + StringParameters tmp_params(args, game_script ? args.GetDataLeft() : 0); GetStringWithArgs(builder, string_id, tmp_params, next_substr_case_index, game_script); next_substr_case_index = 0; break; @@ -1138,7 +1138,7 @@ static void FormatString(StringBuilder & if (game_script && size > args.GetDataLeft()) { builder += "(too many parameters)"; } else { - StringParameters sub_args(args, size); + StringParameters sub_args(args, game_script ? args.GetDataLeft() : size); GetStringWithArgs(builder, string_id, sub_args, next_substr_case_index, game_script); args.AdvanceOffset(size); }