Reset Script module when it is saved

This commit is contained in:
danielyxie 2018-05-13 03:08:18 -05:00
parent abb5b9895f
commit 9a9096bc70
3 changed files with 8 additions and 2 deletions

@ -26144,6 +26144,8 @@ Script.prototype.saveScript = function() {
//Calculate/update ram usage, execution time, etc. //Calculate/update ram usage, execution time, etc.
this.updateRamUsage(); this.updateRamUsage();
this.module = "";
} }
} }
@ -28582,7 +28584,7 @@ function NetscriptFunctions(workerScript) {
} }
var stock = _StockMarket_js__WEBPACK_IMPORTED_MODULE_19__["SymbolToStockMap"][symbol]; var stock = _StockMarket_js__WEBPACK_IMPORTED_MODULE_19__["SymbolToStockMap"][symbol];
if (stock == null) { if (stock == null) {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid stock symbol passed into getStockPrice()"); throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid stock symbol passed into getStockPosition()");
} }
return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx]; return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];
}, },

@ -26144,6 +26144,8 @@ Script.prototype.saveScript = function() {
//Calculate/update ram usage, execution time, etc. //Calculate/update ram usage, execution time, etc.
this.updateRamUsage(); this.updateRamUsage();
this.module = "";
} }
} }
@ -28582,7 +28584,7 @@ function NetscriptFunctions(workerScript) {
} }
var stock = _StockMarket_js__WEBPACK_IMPORTED_MODULE_19__["SymbolToStockMap"][symbol]; var stock = _StockMarket_js__WEBPACK_IMPORTED_MODULE_19__["SymbolToStockMap"][symbol];
if (stock == null) { if (stock == null) {
throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid stock symbol passed into getStockPrice()"); throw Object(_NetscriptEvaluator_js__WEBPACK_IMPORTED_MODULE_23__["makeRuntimeRejectMsg"])(workerScript, "Invalid stock symbol passed into getStockPosition()");
} }
return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx]; return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];
}, },

@ -345,6 +345,8 @@ Script.prototype.saveScript = function() {
//Calculate/update ram usage, execution time, etc. //Calculate/update ram usage, execution time, etc.
this.updateRamUsage(); this.updateRamUsage();
this.module = "";
} }
} }