diff --git a/app/lib/world/thang.coffee b/app/lib/world/thang.coffee index 41544cbca..426e7541f 100644 --- a/app/lib/world/thang.coffee +++ b/app/lib/world/thang.coffee @@ -38,7 +38,7 @@ module.exports = class Thang publishNote: (channel, event) -> event.thang = @ @world.publishNote channel, event - + setGoalState: (goalID, status) -> @world.setGoalState goalID, status diff --git a/app/lib/world/thang_state.coffee b/app/lib/world/thang_state.coffee index 7ea6a9687..655f41b01 100644 --- a/app/lib/world/thang_state.coffee +++ b/app/lib/world/thang_state.coffee @@ -98,10 +98,14 @@ module.exports = class ThangState storage = @trackedPropertyValues[propIndex] value = @getStoredProp propIndex, type, storage if prop is "pos" - @thang.pos = @thang.pos.copy() - @thang.pos.x = inverse * @thang.pos.x + ratio * value.x - @thang.pos.y = inverse * @thang.pos.y + ratio * value.y - @thang.pos.z = inverse * @thang.pos.z + ratio * value.z + if @thang.pos.distanceSquared(value) > 900 + # Don't interpolate; it was probably a teleport. https://github.com/codecombat/codecombat/issues/738 + @thang.pos = value + else + @thang.pos = @thang.pos.copy() + @thang.pos.x = inverse * @thang.pos.x + ratio * value.x + @thang.pos.y = inverse * @thang.pos.y + ratio * value.y + @thang.pos.z = inverse * @thang.pos.z + ratio * value.z else if prop is "rotation" @thang.rotation = inverse * @thang.rotation + ratio * value @thang.partialState = true