This commit is contained in:
Mashy 2019-07-09 16:03:59 +10:00
parent 4fc5f46311
commit fe956936d1
2 changed files with 5 additions and 5 deletions

View File

@ -101,6 +101,7 @@ function animations(props) {
setAvatarAnimation({
source: true,
target: avatarAnimation.target,
id: resolution.id,
animTargetId: construct.id,
type: 'sourceCast',
params: { x, y },

View File

@ -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;
}
};