|
@@ -314,9 +314,20 @@ class Humanoid extends Person {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ this.addGetAlterations((humanoid : Humanoid) => {
|
|
|
+ // Let's not do this for NPCs. It can break patches.
|
|
|
+ let allParts = this.getParts();
|
|
|
+ let changes = {};
|
|
|
+ for (let i = 0; i < allParts.length; i++) {
|
|
|
+ let part = <Bodypart> allParts[i];
|
|
|
+ changes[part.getName()] = part.getChanges();
|
|
|
+ }
|
|
|
+ return {bodyparts : changes};
|
|
|
+ });
|
|
|
+
|
|
|
this.addSetAlterations((humanoid : Humanoid, changes) => {
|
|
|
// Let's not do this for NPCs. It can break patches.
|
|
|
- if (humanoid.isPlayer()) {
|
|
|
+ if (changes.HumanoidGender != undefined) {
|
|
|
humanoid.removeGenderedParts();
|
|
|
if (changes.HumanoidGender == Humanoid.SEX_MALE) {
|
|
|
humanoid.addMaleParts();
|
|
@@ -327,6 +338,19 @@ class Humanoid extends Person {
|
|
|
humanoid.addFemaleParts();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ this.addSetAlterations((humanoid : Humanoid, changes : any) => {
|
|
|
+ if (changes.bodyparts != undefined) {
|
|
|
+ let bpChanges = <any>changes.bodyparts;
|
|
|
+ let allParts = this.getParts();
|
|
|
+ for (let i = 0; i < allParts.length; i++) {
|
|
|
+ let part = <Bodypart>allParts[i];
|
|
|
+ if (bpChanges[part.getName()] != undefined) {
|
|
|
+ part.setChanges(bpChanges[part.getName()]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|