diff --git a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java index 953e5b3..8ffea91 100644 --- a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java +++ b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLidar.java @@ -114,7 +114,8 @@ public class CubotLidar extends CpuHardware implements JSONSerialisable { if (cubot.spendEnergy(10)) { char[][] mapInfo = cubot.getWorld().getMapInfo(); - int i = MEMORY_MAP_START; + //Write map data to the location specified by register X + int i = getCpu().getRegisterSet().getRegister("X").getValue(); for (int y = 0; y < cubot.getWorld().getWorldSize(); y++) { for (int x = 0; x < cubot.getWorld().getWorldSize(); x++) { getCpu().getMemory().set(i++, mapInfo[x][y]);