Ticket #3277: GuiInterface_js.patch
File GuiInterface_js.patch, 1.2 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/GuiInterface.js
1660 1660 let firstMarket = cmpEntityTrader.GetFirstMarket(); 1661 1661 let secondMarket = cmpEntityTrader.GetSecondMarket(); 1662 1662 let result = null; 1663 if ( data.target ===firstMarket)1663 if (!firstMarket) 1664 1664 { 1665 result = { "type": "set first" }; 1666 } 1667 else if (!secondMarket) 1668 { 1665 1669 result = { 1670 "type": "set second", 1671 "gain": cmpEntityTrader.CalculateGain(firstMarket, data.target), 1672 }; 1673 } 1674 else if (data.target === firstMarket) 1675 { 1676 result = { 1666 1677 "type": "is first", 1667 1678 "hasBothMarkets": cmpEntityTrader.HasBothMarkets() 1668 1679 }; … … 1676 1687 "gain": cmpEntityTrader.GetGain(), 1677 1688 }; 1678 1689 } 1679 else if (!firstMarket)1680 {1681 result = { "type": "set first" };1682 }1683 else if (!secondMarket)1684 {1685 result = {1686 "type": "set second",1687 "gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),1688 };1689 }1690 1690 else 1691 1691 { 1692 1692 // Else both markets are not null and target is different from them