diff --git a/src/main/resources/assets/opencomputers/doc/en_US/item/navigationUpgrade.md b/src/main/resources/assets/opencomputers/doc/en_US/item/navigationUpgrade.md index ff513fdb6..4ce1d4ef5 100644 --- a/src/main/resources/assets/opencomputers/doc/en_US/item/navigationUpgrade.md +++ b/src/main/resources/assets/opencomputers/doc/en_US/item/navigationUpgrade.md @@ -4,4 +4,6 @@ The navigation upgrade provides location and orientation information to devices it is installed in. The coordinates the upgrade provides are relative to the center of the map that was used to craft the upgrade, and the functional range is based on the size of that map. -The map inside a Navigation upgrade can be changed by re-crafting the upgrade with a new map. The old map will be returned to the player. \ No newline at end of file +The map inside a Navigation upgrade can be changed by re-crafting the upgrade with a new map. The old map will be returned to the player. + +Note that this upgrade is a lot more useful when used in combination with one or more [waypoints](../block/waypoint.md). \ No newline at end of file diff --git a/src/main/scala/li/cil/oc/server/component/UpgradeNavigation.scala b/src/main/scala/li/cil/oc/server/component/UpgradeNavigation.scala index b1b29cc13..f7afe92db 100644 --- a/src/main/scala/li/cil/oc/server/component/UpgradeNavigation.scala +++ b/src/main/scala/li/cil/oc/server/component/UpgradeNavigation.scala @@ -64,7 +64,7 @@ class UpgradeNavigation(val host: EnvironmentHost with Rotatable) extends prefab val waypoints = Waypoints.findWaypoints(position, range). filter(waypoint => waypoint.getDistanceFrom(positionVec.xCoord, positionVec.yCoord, positionVec.zCoord) <= rangeSq) result(waypoints.map(waypoint => { - val delta = position.toVec3.subtract(waypoint.position.offset(waypoint.facing).toVec3) + val delta = positionVec.subtract(waypoint.position.offset(waypoint.facing).toVec3) Map( "position" -> Array(delta.xCoord, delta.yCoord, delta.zCoord), "redstone" -> waypoint.maxInput, diff --git a/src/main/scala/li/cil/oc/server/machine/luac/NativeLuaArchitecture.scala b/src/main/scala/li/cil/oc/server/machine/luac/NativeLuaArchitecture.scala index 6684ad601..078609918 100644 --- a/src/main/scala/li/cil/oc/server/machine/luac/NativeLuaArchitecture.scala +++ b/src/main/scala/li/cil/oc/server/machine/luac/NativeLuaArchitecture.scala @@ -303,7 +303,7 @@ class NativeLuaArchitecture(val machine: api.machine.Machine) extends Architectu apis.foreach(_.initialize()) - lua.load(classOf[Machine].getResourceAsStream(Settings.scriptPath + "machine.lua"), "=kernel", "t") + lua.load(classOf[Machine].getResourceAsStream(Settings.scriptPath + "machine.lua"), "=machine", "t") lua.newThread() // Left as the first value on the stack. true