remove sumorobot object replacement

This commit is contained in:
Silver Kuusik 2018-01-11 19:34:04 +01:00
parent 13d9a967d9
commit 4361448951

View File

@ -410,16 +410,12 @@ window.onload = function() {
sumostart = true; sumostart = true;
/* if we are in Python mode */ /* if we are in Python mode */
if (pythonEnabled) { if (pythonEnabled) {
/* add the an empty block ID to the functions */ /* send the code from the textarea to the SumoRobot */
var code = $("#blocklyCode").val().replace(/sumorobot./g, "").replace(/\)/g, ", \"\")"); sumorobot.send("start:" + $("#blocklyCode").val());
/* is_enemy doesn't need the , */
code = code.replace(/\(, ""\)/g, "(\"\")");
/* send the code to the SumoRobot */
sumorobot.send("start:" + code);
/* otherwise when we are in blockly mode */ /* otherwise when we are in blockly mode */
} else { } else {
/* send the code to the SumoRobot */ /* send the code from the blocks to the SumoRobot */
sumorobot.send("start:" + sumocode.replace(/sumorobot./g, "")); sumorobot.send("start:" + sumocode);
} }
}); });