Fix Load File mech lookup: use stock_array to get chassis name
mech[j] in the flat sorted array hits variant entries (e.g. 'Assassin2 A' sorts before 'AssassinII' alphabetically, pushing all subsequent chassis indices off by 1 or more). The script's stock_array[] maps each chassis index -> its actual position in the flat mech[] array, bypassing variant entries. Fix: mech[allowed_mechs[j]] -> mech[stock_array[allowed_mechs[j]]] Only stock (chassis) names are supported in Mech= field. Operators can adjust variants manually after Load File is clicked. No rebuild required (script-only change).
This commit is contained in:
@@ -1726,9 +1726,11 @@ main
|
||||
if (!equal$(szAutoMech, ""))
|
||||
{
|
||||
#if USE_ALLOWED_MECHS
|
||||
// stock_array[j] = index in mech[] where chassis j lives (skips variant entries).
|
||||
// mech[allowed_mechs[j]] would hit variant names; stock_array corrects this.
|
||||
for (j = 0; j < MAX_ALLOWED_MECHS; j++)
|
||||
{
|
||||
if equal$(mech[allowed_mechs[j]], szAutoMech)
|
||||
if equal$(mech[stock_array[allowed_mechs[j]]], szAutoMech)
|
||||
{
|
||||
o_mech_variant[k].nselected = j
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user