Skip to content

Commit 8b979f2

Browse files
committed
9.2.2 - fix players unable to complete chargen, duplicated creature talents
close #2383
1 parent 7b8f0d9 commit 8b979f2

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

src/apps/chargen/char-gen.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,11 @@ export default class CharGenWfrp4e extends FormApplication {
378378
localStorage.removeItem("wfrp4e-chargen")
379379
}
380380
else {
381-
const payload = {id : game.user.id, data : this.actor, options : {skipSpecialisationChoice : true, skipItems : true}}
382-
let id = await SocketHandlers.call("createActor", payload, "GM");
383-
let actor = game.actors.get(id);
381+
let actorId = foundry.utils.randomID()
382+
this.actor._id = actorId;
383+
const payload = {id : game.user.id, data : this.actor, options : {skipSpecialisationChoice : true, skipItems : true, keepId : true}}
384+
await SocketHandlers.call("createActor", payload, "GM");
385+
let actor = game.actors.get(actorId);
384386
await actor.createEmbeddedDocuments("Item", actorItems, {skipSpecialisationChoice : true})
385387
if (actor && actor.isOwner)
386388
{

src/sheets/actor/creature-sheet.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ export default class ActorSheetWFRP4eCreature extends StandardWFRP4eActorSheet
8080

8181
context.trained = this.actor.itemTags.skill.filter(i => i.advances.value > 0).sort(WFRP_Utility.nameSorter);
8282
context.includedTraits = this.actor.itemTags.trait.filter(i => i.included).sort(WFRP_Utility.nameSorter);
83-
83+
context.talents = [];
84+
for(let talent of context.items.talent)
85+
{
86+
if (!context.talents.find(existing => existing.name == talent.name))
87+
{
88+
context.talents.push(talent);
89+
}
90+
}
8491

8592
context.overviewButtons = this.actor.items.contents.reduce((buttons, item) => {
8693
let add = [];

static/templates/sheets/actor/creature/creature-main.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{{#if items.talent.length}}
3737
<div class="overview-list">
3838
<label class="list-label">{{localize "Talents"}}:</label>
39-
{{#each items.talent}}
39+
{{#each talents}}
4040
<a data-action="overviewDropdown" class="context-menu-alt" data-click="right" data-uuid="{{this.uuid}}">{{this.name}} </a>
4141
<a class="talents advances">{{this.Advances}}</a>
4242
,

system.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "wfrp4e",
33
"title": "Warhammer Fantasy Roleplay 4th Edition",
44
"description": "A comprehensive system for running grim and perilous games of Warhammer Fantasy Roleplay in the Foundry VTT environment.",
5-
"version": "9.2.1",
5+
"version": "9.2.2",
66
"authors" : [
77
{
88
"name": "Moo Man",
@@ -72,6 +72,6 @@
7272
},
7373
"socket": true,
7474
"manifest" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/latest/download/system.json",
75-
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/9.2.1/wfrp4e.zip",
75+
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/9.2.2/wfrp4e.zip",
7676
"url" : "https://github.com/moo-man/WFRP4e-FoundryVTT"
7777
}

0 commit comments

Comments
 (0)