mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Fixed #738.
This commit is contained in:
parent
62f91d14b0
commit
255cef83fb
2 changed files with 9 additions and 5 deletions
|
@ -38,7 +38,7 @@ module.exports = class Thang
|
|||
publishNote: (channel, event) ->
|
||||
event.thang = @
|
||||
@world.publishNote channel, event
|
||||
|
||||
|
||||
setGoalState: (goalID, status) ->
|
||||
@world.setGoalState goalID, status
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue