Extend MP mission time limit to 240 min (from LYLT 3514acf6)

Time-limit pick lists go to 23 entries: 1-15, 20, 25, 30, 45, 60, 120,
180, 240. Content + console only, no MW4.exe rebuild -- nothing between
the dropdown and the mission timer clamps the value, and m_gameLength is
8 bits on the wire (MWApplication.cpp:790), so 255 was always the ceiling.

Hand-applied rather than merged. LYLT reverted aa500be7 (9aa317ea) and
built on the original 9-entry list, while this branch carries the fixed
18-entry version from 456e1978, so the two sides have different bases.
Merging the branch would also drag in that revert of the Battlemaster and
Behemoth loadout work.

Two deliberate deviations from 3514acf6:

- Its max_displayed restructure is NOT taken. Both sides independently
  reached the same logic (i==5 -> 10, i==6 -> 4, else 16), but LYLT wrote
  the outer else without braces. That bare else-then-if is the construct
  behind the null-reference console lobby crash in the aa500be7
  regression; 456e1978 already fixed it here. Ours is kept.
- HostLobbyMission.script was untouched on this branch so LYLT's version
  is taken wholesale, but its else block (i==5 / i==11) is re-braced for
  the same reason before it can bite the PC host lobby.

Fixes a real bug this branch already had: TIME_LIST_DEFAULT was still the
C++ global g_nTimeList_Index (3), which indexed "7" in the old 9-entry
list but indexes "4" in the expanded one -- the default mission time had
silently become 4 minutes. Now the literal 6, which is "7" in both the
18- and 23-entry lists. Kept as a literal so the script stays independent
of the exe; the reset-to-defaults path matches by value (g_nTimeList_Value
= 7) and needed no change.

The rest scales on its own: drop_list_size[5], the doh loop bounds and the
nselected fallbacks in ConLobbyMission all already used TIME_LIST_COUNT /
TIME_LIST_DEFAULT symbolically. The DEMO_CODE list (11 entries, default 5)
is untouched. Verified 23 contiguous entries and balanced braces in both
files, no unbraced else-if left, CRLF and us-ascii preserved.

Not yet repacked: these live in props.mw4, so run build-env\build-resources.ps1
on the Windows box, deleting resource\props.mw4 + props.dep first to force a
full repack (incremental carries stale entries forward). Not run on a real bay.

Co-authored-by: Claude Opus 5 (Anthropic) <noreply@anthropic.com>
Co-authored-by: GitHub Copilot <copilot@github.com>
This commit is contained in:
2026-08-06 14:51:01 -05:00
co-authored by Claude Opus 5 GitHub Copilot
parent 020dc04612
commit 136e2ff05c
3 changed files with 204 additions and 19 deletions
@@ -39,8 +39,8 @@
#define TIME_LIST_DEFAULT $$g_nTimeList_Index$$ // 5 // 7 minutes
#define TIME_VALUE_DEFAULT $$g_nTimeList_Value$$ // 7 // 7 minutes
#else // !DEMO_CODE
#define TIME_LIST_COUNT 18 // MSL // expanded 1-15, 20, 25, 30 min
#define TIME_LIST_DEFAULT $$g_nTimeList_Index$$ // 3 // 7 minutes
#define TIME_LIST_COUNT 23 // MSL // expanded 1-15, 20, 25, 30, 45, 60, 120, 180, 240 min
#define TIME_LIST_DEFAULT 6 // index of "7"; the C++ g_nTimeList_Index (3) indexed the old 9-entry list
#define TIME_VALUE_DEFAULT $$g_nTimeList_Value$$ // 7 // 7 minutes
#endif // DEMO_CODE
@@ -485,6 +485,11 @@ main
o_game_options[i].list_item[15] = "20"
o_game_options[i].list_item[16] = "25"
o_game_options[i].list_item[17] = "30"
o_game_options[i].list_item[18] = "45"
o_game_options[i].list_item[19] = "60"
o_game_options[i].list_item[20] = "120"
o_game_options[i].list_item[21] = "180"
o_game_options[i].list_item[22] = "240"
if callback($$GetLocalNetworkMissionParamater$$, time_limit) == 0
o_game_options[i].nselected = TIME_LIST_DEFAULT
@@ -110,7 +110,7 @@ main
drop_list_size[2] = 2
drop_list_size[3] = 5
drop_list_size[4] = 2
drop_list_size[5] = 9
drop_list_size[5] = 23 // [LYLT] extended time list
drop_list_size[6] = 10
drop_list_size[7] = 10
drop_list_size[8] = 2
@@ -202,13 +202,20 @@ main
o_game_options[i].offsetLabel = drop_name_loc[i]
o_game_options[i].arrowHeight = 15
if i == 11
if i == 5 // extended time list -> scroll instead of overflowing the panel
{
o_game_options[i].max_displayed = 4
o_game_options[i].max_displayed = 10
}
else
{
o_game_options[i].max_displayed = 16
if i == 11
{
o_game_options[i].max_displayed = 4
}
else
{
o_game_options[i].max_displayed = 16
}
}
}
else
@@ -545,24 +552,38 @@ main
{
o_game_options[i].list_item[0] = "1"
o_game_options[i].list_item[1] = "2"
o_game_options[i].list_item[2] = "5"
o_game_options[i].list_item[3] = "10"
o_game_options[i].list_item[4] = "15"
o_game_options[i].list_item[5] = "30"
o_game_options[i].list_item[6] = "60"
o_game_options[i].list_item[7] = "90"
o_game_options[i].list_item[8] = "120"
o_game_options[i].list_item[2] = "3"
o_game_options[i].list_item[3] = "4"
o_game_options[i].list_item[4] = "5"
o_game_options[i].list_item[5] = "6"
o_game_options[i].list_item[6] = "7"
o_game_options[i].list_item[7] = "8"
o_game_options[i].list_item[8] = "9"
o_game_options[i].list_item[9] = "10"
o_game_options[i].list_item[10] = "11"
o_game_options[i].list_item[11] = "12"
o_game_options[i].list_item[12] = "13"
o_game_options[i].list_item[13] = "14"
o_game_options[i].list_item[14] = "15"
o_game_options[i].list_item[15] = "20"
o_game_options[i].list_item[16] = "25"
o_game_options[i].list_item[17] = "30"
o_game_options[i].list_item[18] = "45"
o_game_options[i].list_item[19] = "60"
o_game_options[i].list_item[20] = "120"
o_game_options[i].list_item[21] = "180"
o_game_options[i].list_item[22] = "240"
if callback($$GetLocalNetworkMissionParamater$$, time_limit) == 0
o_game_options[i].nselected = 3
o_game_options[i].nselected = 6 // [LYLT] index of "7"
else
{
for int doh = 0; doh< 9; doh++
for int doh = 0; doh< 23; doh++
{
if makeint(o_game_options[i].list_item[doh]) >= callback($$GetLocalNetworkMissionParamater$$, time_limit)
{
o_game_options[i].nselected = doh
doh = 9
doh = 23
}
}
}
@@ -784,15 +805,15 @@ main
//------------------------------------------------------------------------
i = 5
if callback($$GetLocalNetworkMissionParamater$$, time_limit) == 0
o_game_options[i].nselected = 3
o_game_options[i].nselected = 6 // [LYLT] index of "7"
else
{
for int doh = 0; doh< 9; doh++
for int doh = 0; doh< 23; doh++
{
if makeint(o_game_options[i].list_item[doh]) >= callback($$GetLocalNetworkMissionParamater$$, time_limit)
{
o_game_options[i].nselected = doh
doh = 9
doh = 23
}
}
}