I believe the piece of code responsible is right here in my equip function and the problem is trying to read the id of the item if I remove it.
I have classes changing with a particular item in a slot so when nothing is there it needs to revert back to the default class.
How would I correctly be able to detect that an item was removed without an error? Clearing everything I can easily handle by just changing class to default in the function.
I have classes changing with a particular item in a slot so when nothing is there it needs to revert back to the default class.
Code:
var itemHolder = this.actor().equips()[5].id;
if(this.actor().equips()[5] == null){ //empty
this.actor().changeClass(5, true);
}
else{
this.actor().changeClass($dataArmors[itemHolder].meta.c, true);
}
How would I correctly be able to detect that an item was removed without an error? Clearing everything I can easily handle by just changing class to default in the function.