Fix if a character is replaced with another sprite of themselves it doesn't remove the old one.

This commit is contained in:
firebingo 2018-05-11 10:33:20 -07:00
parent 447eb0b3dd
commit 4e69b2388f
3 changed files with 4 additions and 5 deletions

View file

@ -856,7 +856,7 @@ class Player {
}
//If the layer already has a different character on it remove it.
if(prevChar && (prevChar.character.NameText !== chr.NameText || prevChar.character.Pattern !== chr.Pattern)) {
if(prevChar && (prevChar.charName !== cur.Arg1 || prevChar.character.Pattern !== chr.Pattern)) {
this.lerpTargets.push({type: 'alpha', object: prevChar.sprite, curTime: 0, time: 200, finalV: 0, initV: 1, post: "destroy" });
this.currentCharacters[cur.Arg3] = undefined;
}