Skip to content

Commit 5024b9e

Browse files
committed
Fix infighter, actor entry context options, token size calculation, and duplicate reload tests, fix ingredient spell selector not showing
close #2511 close #2503
1 parent 482a0fc commit 5024b9e

7 files changed

Lines changed: 18 additions & 16 deletions

File tree

scripts/7f6OsttTzE7Hvzfk.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
if (this.actor.statuses.has("infighting")) // Only add +10 if already infighting
2-
args.prefillModifiers.modifier += 10;
1+
if (this.actor.statuses.has("infighting") && !args.flags.infighter)
2+
{
3+
args.fields.modifier += 10;
4+
args.flags.infighter = true;
5+
}
36

4-
5-
args.prefillModifiers.successBonus += 1;
7+
args.fields.successBonus += 1;

scripts/sgS9rblPkQB36C8S.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let index = game.packs
1414
return i
1515
})
1616

17-
let choice = await ItemDialog.create(index, 1, "Choose a Trade Skill")
17+
let choice = await ItemDialog.create(index, 1, {text : "Choose a Trade Skill, or select none to enter manually.", title : this.effect.name})
1818
let text;
1919
if (!choice[0])
2020
{

src/hooks/entryContext.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ export default function () {
1111
/**
1212
* Add right click option to actors to add all basic skills
1313
*/
14-
Hooks.on("getActorDirectoryEntryContext", async (html, options) => {
14+
Hooks.on("getActorContextOptions", async (html, options) => {
1515
options.push(
1616
{
1717
name: game.i18n.localize("ACTOR.AddBasicSkills"),
1818
condition: game.user.isGM,
1919
icon: '<i class="fas fa-plus"></i>',
2020
callback: target => {
21-
const actor = game.actors.get(target.attr('data-document-id'));
21+
const actor = game.actors.get(target.dataset.entryId);
2222
actor.addBasicSkills();
2323
}
2424
})
@@ -28,7 +28,7 @@ export default function () {
2828
name: game.i18n.localize("ACTOR.ClearMount"),
2929
icon: '<i class="fas fa-horse"></i>',
3030
callback: target => {
31-
const actor = game.actors.get(target.attr('data-document-id'));
31+
const actor = game.actors.get(target.dataset.entryId);
3232
return actor.update({
3333
"system.status.mount": {
3434
"id": "",
@@ -49,7 +49,7 @@ export default function () {
4949
condition: game.user.isGM,
5050
icon: '<i class="fa fa-download"></i>',
5151
callback: target => {
52-
const actor = game.actors.get(target.attr('data-document-id'));
52+
const actor = game.actors.get(target.dataset.entryId);
5353
new StatBlockParser(actor).render(true)
5454
}
5555
})

src/model/actor/base.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ export class BaseActorModel extends BaseWarhammerActorModel {
104104
// Resize tokens based on size property
105105
checkSize() {
106106
let actor = this.parent
107-
if (game.user.id != getActiveDocumentOwner(actor)?.id) {
108-
return
109-
}
110-
if (actor.flags.autoCalcSize && game.canvas.ready) {
107+
108+
// if (game.user.id != getActiveDocumentOwner(actor)?.id) {
109+
// return
110+
// }
111+
if (actor.system.autoCalc.size && game.canvas.ready) {
111112
let tokenData = this.tokenSize();
112113
if (actor.isToken)
113114
{

src/system/advancement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export default class Advancement
427427
{
428428
for (let i = 0; i < talent; i++) {
429429
let result = await game.wfrp4e.tables.rollTable("talents")
430-
talentsToAdd.push(await this._advanceTalent(result.object.text));
430+
talentsToAdd.push(await this._advanceTalent(result.object.name));
431431
}
432432
continue
433433
}

src/system/rolls/weapon-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export default class WeaponTest extends AttackTest {
116116
this.item.system.loaded.value = false;
117117

118118
let item = await this.item.update({ "system.loaded.amt": this.item.system.loaded.amt, "system.loaded.value": this.item.system.loaded.value });
119-
await this.item.actor.checkReloadExtendedTest(item, this.actor);
120119
}
121120
else {
122121
await this.item.update({ "system.loaded.amt": this.item.system.loaded.amt })

static/templates/sheets/actor/tabs/actor-inventory.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<img src="{{this.img}}">
115115
<a class="label" data-action="toggleSummary">{{this.name}}</a>
116116
</div>
117-
{{#if (eq @../key "ingredients")}}
117+
{{#if (eq @../key "ingredient")}}
118118
<div class="flex">
119119
<select data-action="editProperty" data-path="system.spellIngredient.value">
120120
{{#select system.spellIngredient.value}}

0 commit comments

Comments
 (0)