diff --git a/module/actor/entity.js b/module/actor/entity.js index 3d8855f9..83ab6142 100644 --- a/module/actor/entity.js +++ b/module/actor/entity.js @@ -1982,68 +1982,58 @@ export default class Actor5e extends Actor { const charName = char.data.name; const charRank = char.data.data.attributes.rank; let charProf = 0; - if (charRank.total > 0) { + if (charRank === undefined || charRank.total > 0) { charProf = char.data.data.attributes.prof; } if (coord) { ssDeploy.coord.uuid = charUUID; ssDeploy.coord.name = charName; - ssDeploy.coord.rank = charRank.coord; + ssDeploy.coord.rank = charRank ? charRank.coord : 0; ssDeploy.coord.prof = charProf; } if (gunner) { ssDeploy.gunner.uuid = charUUID; ssDeploy.gunner.name = charName; - ssDeploy.gunner.rank = charRank.gunner; + ssDeploy.gunner.rank = charRank ? charRank.gunner : 0; ssDeploy.gunner.prof = charProf; } if (mech) { ssDeploy.mechanic.uuid = charUUID; ssDeploy.mechanic.name = charName; - ssDeploy.mechanic.rank = charRank.mechanic; + ssDeploy.mechanic.rank = charRank ? charRank.mechanic : 0; ssDeploy.mechanic.prof = charProf; } if (oper) { ssDeploy.operator.uuid = charUUID; ssDeploy.operator.name = charName; - ssDeploy.operator.rank = charRank.operator; + ssDeploy.operator.rank = charRank ? charRank.operator : 0; ssDeploy.operator.prof = charProf; } if (pilot) { ssDeploy.pilot.uuid = charUUID; ssDeploy.pilot.name = charName; - ssDeploy.pilot.rank = charRank.pilot; + ssDeploy.pilot.rank = charRank ? charRank.pilot : 0; ssDeploy.pilot.prof = charProf; } if (tech) { ssDeploy.technician.uuid = charUUID; ssDeploy.technician.name = charName; - ssDeploy.technician.rank = charRank.technician; + ssDeploy.technician.rank = charRank ? charRank.technician : 0; ssDeploy.technician.prof = charProf; } if (crew) { - ssDeploy.crew.push({ - uuid: charUUID, - name: charName, - rank: charRank, - prof: charProf - }); + ssDeploy.crew.push({uuid: charUUID, name: charName, rank: charRank, prof: charProf}); } if (pass) { - ssDeploy.passenger.push({ - uuid: charUUID, - name: charName, - rank: charRank, - prof: charProf - }); + ssDeploy.passenger.push({uuid: charUUID, name: charName, rank: charRank, prof: charProf}); } this.update({"data.attributes.deployment": ssDeploy}); } diff --git a/templates/actors/newActor/parts/swalt-crew.html b/templates/actors/newActor/parts/swalt-crew.html index 16c50787..423f7cc4 100644 --- a/templates/actors/newActor/parts/swalt-crew.html +++ b/templates/actors/newActor/parts/swalt-crew.html @@ -8,6 +8,26 @@
  • {{localize "SW5E.Reaction"}}
  • +
      +
    1. Coordinator: {{data.attributes.deployment.coord.name}}
    2. +
    3. Rank: {{data.attributes.deployment.coord.rank}}
    4. +
    5. Prof: {{data.attributes.deployment.coord.prof}}
    6. +
    7. Gunner: {{data.attributes.deployment.gunner.name}}
    8. +
    9. Rank: {{data.attributes.deployment.gunner.rank}}
    10. +
    11. Prof: {{data.attributes.deployment.gunner.prof}}
    12. +
    13. Mechanic: {{data.attributes.deployment.mechanic.name}}
    14. +
    15. Rank: {{data.attributes.deployment.mechanic.rank}}
    16. +
    17. Prof: {{data.attributes.deployment.mechanic.prof}}
    18. +
    19. Operator: {{data.attributes.deployment.operator.name}}
    20. +
    21. Rank: {{data.attributes.deployment.operator.rank}}
    22. +
    23. Prof: {{data.attributes.deployment.operator.prof}}
    24. +
    25. Pilot: {{data.attributes.deployment.pilot.name}}
    26. +
    27. Rank: {{data.attributes.deployment.pilot.rank}}
    28. +
    29. Prof: {{data.attributes.deployment.pilot.prof}}
    30. +
    31. Technician: {{data.attributes.deployment.technician.name}}
    32. +
    33. Rank: {{data.attributes.deployment.technician.rank}}
    34. +
    35. Prof: {{data.attributes.deployment.technician.prof}}
    36. +
      {{#each sections as |section sid|}}