Skip to content

Commit 2c03baa

Browse files
committed
fixed change log bug on actors without one
1 parent 76a97e8 commit 2c03baa

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

Diff for: README.md

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ This system provides character sheets and items for your play, if you would lik
2929

3030

3131
## Release Notes
32+
v4.6.1
33+
- 🐛 system was attempting to update the change log for actors without one which caused changes to fail on NPC and Vaesen actor type [#117](https://github.com/fvtt-fria-ligan/vaesen-foundry-vtt/issues/117)
34+
- 🐛 error when updating actors when no scene was active
3235

3336
v4.6.0
3437
- ✨ Use Foundry's tooltip instead of browser `title`

Diff for: script/actor/vaesen.js

+3
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ export class VaesenActor extends Actor {
188188
}
189189

190190
async _handleItem(document, userId, textType) {
191+
const actorChanged = this;
192+
// if we are not dealing with a player or headquarter, we don't want to log the changes
193+
if (actorChanged.type != "player" && actorChanged.type != "headquarter") return;
191194
const byText = game.i18n.localize("CHANGELOG.BY");
192195
const atText = game.i18n.localize("CHANGELOG.AT");
193196
const dateChanged = new Date().toLocaleString();

Diff for: script/hooks.js

+3
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ Hooks.on('canvasReady', () => {
114114
});
115115

116116
Hooks.on("updateActor", (actor,changes,diff,userId) => {
117+
// if we don't have an active scene, don't do anything
118+
if (!game.scenes.current) return;
119+
console.log("updateActor", actor, changes, diff, userId);
117120
game.scenes.current.tokens.forEach(x => {
118121
if (x.actorId !== actor._id)
119122
return;

Diff for: system.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Vaesen",
33
"description": "Nordic horror role-playing",
4-
"version": "4.6.0",
4+
"version": "4.6.1",
55
"esmodules": [
66
"script/hooks.js"
77
],
@@ -89,7 +89,7 @@
8989
"url": "https://github.com/fvtt-fria-ligan/vaesen-foundry-vtt",
9090
"socket": true,
9191
"manifest": "https://github.com/fvtt-fria-ligan/vaesen-foundry-vtt/releases/latest/download/system.json",
92-
"download": "https://github.com/fvtt-fria-ligan/vaesen-foundry-vtt/releases/download/4.5.3/system.zip",
92+
"download": "https://github.com/fvtt-fria-ligan/vaesen-foundry-vtt/releases/download/4.6.1/system.zip",
9393
"license": "LICENSE.txt",
9494
"id": "vaesen",
9595
"authors": [

0 commit comments

Comments
 (0)