miijs 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +7 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1570,6 +1570,12 @@ function makeChild(parent0, parent1, options) {
1570
1570
  if(parent0.console.toLowerCase()==="wii") parent0=convertMii(parent0,"3DS");
1571
1571
  if(parent1.console.toLowerCase()==="wii") parent1=convertMii(parent1,"3DS");
1572
1572
 
1573
+ if(parent0.general.gender!==0){
1574
+ let tempHolder=structuredClone(parent0);
1575
+ parent0=structuredClone(parent1);
1576
+ parent1=structuredClone(tempHolder);
1577
+ }
1578
+
1573
1579
  var randomBytes = [];
1574
1580
  for (var i = 0; i < 8; i++) {
1575
1581
  //randomBytes[1] is never used, kept here purely for an interesting detail from research
@@ -1601,7 +1607,6 @@ function makeChild(parent0, parent1, options) {
1601
1607
  child.meta.name = options?.hasOwnProperty("name")? options.name : childGenTables.names[child.general.gender][Math.floor(Math.random() * childGenTables.names[child.general.gender].length)];
1602
1608
 
1603
1609
  var matchingParent = parent0.general.gender === gender ? parent0 : parent1;
1604
- var mainParentFlag = (matchingParent === parent0) ? 0 : 1;
1605
1610
 
1606
1611
  //Skin color mixing. Intuitively you'd think they'd order them by similarity and pick an average, but no they have an entire table of what skin colors product what child skin color
1607
1612
  var validValues = childGenTables.skinColorMixing[Math.min(parent0.face.color, parent1.face.color)][Math.max(parent0.face.color, parent1.face.color)].filter(v => v !== -1);
@@ -1618,8 +1623,6 @@ function makeChild(parent0, parent1, options) {
1618
1623
  child.eyebrows.page = matchingParent.eyebrows.page;
1619
1624
  child.eyebrows.type = matchingParent.eyebrows.type;
1620
1625
 
1621
- child.face.color = [7, 7, 6, 7][Math.min(child.face.color, 3)];
1622
-
1623
1626
  child.eyebrows.color = child.hair.color;
1624
1627
 
1625
1628
  child.nose.page = randomBytes[5] === 0 ? parent0.nose.page : parent1.nose.page;
@@ -1713,7 +1716,7 @@ function makeChild(parent0, parent1, options) {
1713
1716
  child.stages[5].hair.type = hairType;
1714
1717
  break;
1715
1718
  }
1716
- if (mainParentFlag === 0) {
1719
+ if (child.stages[0].general.gender === 0) {
1717
1720
  if (iHairStage === 0) {
1718
1721
  ageGroup = Math.min(ageGroup + 1, 3);
1719
1722
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miijs",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "The most complete and easy to use Mii library on the market.",
5
5
  "main": "index.js",
6
6
  "scripts": {