diff --git a/client/src/components/animations.jsx b/client/src/components/animations.jsx index a290c9eb..1a715313 100644 --- a/client/src/components/animations.jsx +++ b/client/src/components/animations.jsx @@ -101,6 +101,7 @@ function animations(props) { setAvatarAnimation({ source: true, target: avatarAnimation.target, + id: resolution.id, animTargetId: construct.id, type: 'sourceCast', params: { x, y }, diff --git a/client/src/components/construct.jsx b/client/src/components/construct.jsx index 3419ca5b..c1d8710e 100644 --- a/client/src/components/construct.jsx +++ b/client/src/components/construct.jsx @@ -57,15 +57,14 @@ class ConstructAvatar extends Component { } componentWillReceiveProps(nextProps) { - const animations = nextProps.avatarAnimation; - if (animations.id === -1) this.animId = 0; // The current set of resolutions ended reset to 0 - if (animations.id !== this.animId && animations.animTargetId === this.props.id) { + if (nextProps.avatarAnimation.id === -1) this.animId = 0; // The current set of resolutions ended reset to 0 + if (nextProps.avatarAnimation.id !== this.animId && nextProps.avatarAnimation.animTargetId === this.props.id) { this.animId = nextProps.avatarAnimation.id; const selectAnim = () => { - switch (animations.type) { + switch (nextProps.avatarAnimation.type) { case 'banish': return banish(this.props.id); case 'invert': return invert(this.props.id); - case 'sourceCast': return sourceCast(this.props.id, animations.params); + case 'sourceCast': return sourceCast(this.props.id, nextProps.avatarAnimation.params); default: return null; } };