Mercurial > hg > batmud > materials
changeset 13:bacc4457c035
Simplify single material reverse alloy computation a bit.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 04 Jan 2016 14:05:27 +0200 |
parents | 6523f431e731 |
children | 06525e53622d |
files | info.php |
diffstat | 1 files changed, 6 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/info.php Mon Jan 04 11:15:32 2016 +0200 +++ b/info.php Mon Jan 04 14:05:27 2016 +0200 @@ -312,19 +312,16 @@ echo "<h3>Alloy combinations</h3>\n"; if (isset($alloyRevTable[$setShowMat])) { - $ptable1 = []; + $ptable1 = array_keys($alloyRevTable[$setShowMat]); $ptable2 = []; - foreach ($matDataTable as $name1 => $data1) - foreach ($matDataTable as $name2 => $data2) - if (isset($alloyRevTable[$setShowMat][$name1][$name2])) - { - $ptable1[$name1] = 1; - $ptable2[$name2] = 1; - } + foreach ($alloyRevTable[$setShowMat] as $name => $val) + foreach ($val as $qname => $qval) + $ptable2[$qname] = 1; ksort($ptable1); ksort($ptable2); - stPrintAlloyTable("alloyTable", array_keys($ptable1), array_keys($ptable2), FALSE, $setShowMat); + + stPrintAlloyTable("alloyTable", $ptable1, array_keys($ptable2), FALSE, $setShowMat); } else {