Created
April 6, 2016 22:52
-
-
Save VirtuosiMedia/b6f99d693d609ea8a3ea70bc144a01d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Cancels an order for a good from a holding. | |
* @param {int} holdingId The holding id. | |
* @param {string} good The good id. | |
*/ | |
cancelTradeOrder: function(holdingId, good){ | |
var holding = jg.data.holdings[holdingId]; | |
var order = holding.data.economic.trade.orders[good]; | |
if (order.orderType === 'order'){ | |
holding.resources.supply.credits += order.total; | |
} | |
delete holding.data.economic.trade.orders[good]; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment