From 1671f88388d336a6ee3350c0365b4e1fdf02a98d Mon Sep 17 00:00:00 2001
From: Graham Trott <gtanyware@gmail.com>
Date: Mon, 6 Jul 2020 15:03:12 +0100
Subject: [PATCH] Fix path problem

---
 dist/plugins/iwsy.js | 32 ++++++++++++++++----------------
 iwsy/iwsy.js         |  3 +--
 js/plugins/iwsy.js   | 32 ++++++++++++++++----------------
 3 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/dist/plugins/iwsy.js b/dist/plugins/iwsy.js
index dd14620..ec86252 100644
--- a/dist/plugins/iwsy.js
+++ b/dist/plugins/iwsy.js
@@ -30,7 +30,7 @@ const EasyCoder_IWSY = {
 				}
 				break;
 			case `init`:
-				const cdn = compiler.nextValue();
+				const cdn = compiler.getNextValue();
 				compiler.addCommand({
 					domain: `iwsy`,
 					keyword: `iwsy`,
@@ -60,16 +60,16 @@ const EasyCoder_IWSY = {
 					return true;
 				}
 				return false;	
-			case `path`:	
-				const path = compiler.getNextValue();
-				compiler.addCommand({
-					domain: `iwsy`,
-					keyword: `iwsy`,
-					lino,
-					action,
-					path
-				});
-				return true;			
+			// case `path`:	
+			// 	const path = compiler.getNextValue();
+			// 	compiler.addCommand({
+			// 		domain: `iwsy`,
+			// 		keyword: `iwsy`,
+			// 		lino,
+			// 		action,
+			// 		path
+			// 	});
+			// 	return true;			
 			case `script`:
 				const script = compiler.getNextValue();
 				compiler.addCommand({
@@ -193,11 +193,11 @@ const EasyCoder_IWSY = {
 				}
 				program.iwsyFunctions = IWSY(player, script);
 				break;
-			case `path`:
-				if (program.iwsyFunctions) {
-					program.iwsyFunctions.setPath(program.getValue(command.path));
-				}
-				break;
+			// case `path`:
+			// 	if (program.iwsyFunctions) {
+			// 		program.iwsyFunctions.setPath(program.getValue(command.path));
+			// 	}
+			// 	break;
 			case `script`:
 				script = program.getValue(command.script);
 				try {
diff --git a/iwsy/iwsy.js b/iwsy/iwsy.js
index b6389a4..764e571 100644
--- a/iwsy/iwsy.js
+++ b/iwsy/iwsy.js
@@ -988,7 +988,7 @@ const IWSY = (playerElement, scriptObject) => {
 					script.runMode = runMode;
 					doStep(script.steps[1]);
 				} else {
-					fetch(`${script.path}${step.script}?v=${Date.now()}`)
+					fetch(`${step.path}${step.script}?v=${Date.now()}`)
 						.then(response => {
 							if (response.status >= 400) {
 								throw Error(`Unable to load ${step.script}: ${response.status}`);
@@ -1267,7 +1267,6 @@ const IWSY = (playerElement, scriptObject) => {
 	return {
 		getScript,
 		setScript,
-		setPath,
 		gotoStep,
 		block,
 		run,
diff --git a/js/plugins/iwsy.js b/js/plugins/iwsy.js
index dd14620..ec86252 100644
--- a/js/plugins/iwsy.js
+++ b/js/plugins/iwsy.js
@@ -30,7 +30,7 @@ const EasyCoder_IWSY = {
 				}
 				break;
 			case `init`:
-				const cdn = compiler.nextValue();
+				const cdn = compiler.getNextValue();
 				compiler.addCommand({
 					domain: `iwsy`,
 					keyword: `iwsy`,
@@ -60,16 +60,16 @@ const EasyCoder_IWSY = {
 					return true;
 				}
 				return false;	
-			case `path`:	
-				const path = compiler.getNextValue();
-				compiler.addCommand({
-					domain: `iwsy`,
-					keyword: `iwsy`,
-					lino,
-					action,
-					path
-				});
-				return true;			
+			// case `path`:	
+			// 	const path = compiler.getNextValue();
+			// 	compiler.addCommand({
+			// 		domain: `iwsy`,
+			// 		keyword: `iwsy`,
+			// 		lino,
+			// 		action,
+			// 		path
+			// 	});
+			// 	return true;			
 			case `script`:
 				const script = compiler.getNextValue();
 				compiler.addCommand({
@@ -193,11 +193,11 @@ const EasyCoder_IWSY = {
 				}
 				program.iwsyFunctions = IWSY(player, script);
 				break;
-			case `path`:
-				if (program.iwsyFunctions) {
-					program.iwsyFunctions.setPath(program.getValue(command.path));
-				}
-				break;
+			// case `path`:
+			// 	if (program.iwsyFunctions) {
+			// 		program.iwsyFunctions.setPath(program.getValue(command.path));
+			// 	}
+			// 	break;
 			case `script`:
 				script = program.getValue(command.script);
 				try {