Skip to content

Commit

Permalink
compute vehicle move
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Jun 27, 2024
1 parent 1a3e896 commit ded9f5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions modules/model/actor/components/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@ export class VehicleDetailsModel extends foundry.abstract.DataModel {
return crewEncumbrance
}

computeMove()
{
if (this.move.custom.label && this.move.custom.value)
{
this.move.value = this.move.custom.value;
}
else
{
this.move.value = this.move[this.move.primary].value || 0;
}
this.move.display = this.formatMoveString();
}

formatMoveString()
{
let string = "";
Expand Down
2 changes: 1 addition & 1 deletion modules/model/actor/vehicle.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class VehicleModel extends BaseActorModel {
this.characteristics.t.computeBonus();
this.collision = this.characteristics.t.bonus + this.status.wounds.bonus
this.computeEncumbrance(items, flags);
this.details.move.display = this.details.formatMoveString();
this.details.computeMove();
this.parent.runScripts("prepareData", { actor: this.parent })
}

Expand Down

0 comments on commit ded9f5d

Please sign in to comment.