# HG changeset patch # User Matti Hamalainen # Date 1451523939 -7200 # Node ID 7e6ca29133bb45fda5e6bace088a9f05edd66e67 # Parent 27356bea526af2a7d09d84d0286ca6605f3e59c7 Show full mix "formula" if there are no known alloy combos. diff -r 27356bea526a -r 7e6ca29133bb materials/info.php --- a/materials/info.php Thu Dec 31 03:04:48 2015 +0200 +++ b/materials/info.php Thu Dec 31 03:05:39 2015 +0200 @@ -254,25 +254,23 @@ // No alloy combos known, show "generic" formula // echo "

No known alloy combinations.

\n"; - } + + $typeMats = []; + foreach ($matDataTable as $name => $data) + { + if ($data[14] == $matDataTable[$setShowMat][14] && $name != $setShowMat) + $typeMats[] = $name; + } -/* - $typeMats = []; - foreach ($matDataTable as $name => $data) - { - if ($data[14] == $matDataTable[$setShowMat][14] && $name != $setShowMat) - $typeMats[] = $name; + echo "

Full mix: "; + if (list($a, $b) = each($typeMats)) + echo stGetMatLink($b); + + while (list($a, $b) = each($typeMats)) + echo " + ".stGetMatLink($b); + echo "

\n"; } - echo "

Full mix: "; - if (list($a, $b) = each($typeMats)) - echo stGetMatLink($b); - - while (list($a, $b) = each($typeMats)) - echo " + ".stGetMatLink($b); - echo "

\n"; -*/ - // // Show mix table for this material //