fix(gowlers-tracking-ledger): use correct Foundry combat hooks for v11

- Change combatStart hook to createCombat (correct hook for Foundry v11)
- Change combatEnd hook to deleteCombat (correct hook when combat is deleted)
- Add debug logging to confirm combat hooks are registered
- Update version to 0.1.10

Fixes issue where combat end was never being detected, preventing encounter
status from being updated to 'finished' and XP from being linked to encounters.

The console logs showed onCombatEnd was never firing because the hooks had
incorrect names for Foundry v11.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
centron\schwoerer
2025-11-20 10:16:56 +01:00
parent 049f47c4b3
commit f050a988f9
2 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
const MODULE_ID = "gowlers-tracking-ledger"; const MODULE_ID = "gowlers-tracking-ledger";
const MODULE_VERSION = "0.1.9"; const MODULE_VERSION = "0.1.10";
const TRACK_SETTING = "actorSettings"; const TRACK_SETTING = "actorSettings";
const FLAG_SCOPE = "world"; const FLAG_SCOPE = "world";
const MAX_HISTORY_ROWS = 100; const MAX_HISTORY_ROWS = 100;
@@ -146,10 +146,12 @@ async function initializeModule() {
); );
// Track combat encounters // Track combat encounters
Hooks.on("combatStart", (combat) => onCombatStart(combat)); Hooks.on("createCombat", (combat) => onCombatStart(combat));
Hooks.on("combatEnd", (combat) => onCombatEnd(combat)); Hooks.on("deleteCombat", (combat) => onCombatEnd(combat));
Hooks.on("updateCombat", (combat) => onCombatUpdate(combat)); Hooks.on("updateCombat", (combat) => onCombatUpdate(combat));
console.log("[GowlersTracking] Combat hooks registered: createCombat, deleteCombat, updateCombat");
const api = { const api = {
initialized: true, initialized: true,
openConfig: () => new TrackingLedgerConfig().render(true), openConfig: () => new TrackingLedgerConfig().render(true),

View File

@@ -3,7 +3,7 @@
"type": "module", "type": "module",
"title": "Gowler's Tracking Ledger", "title": "Gowler's Tracking Ledger",
"description": "Adds HP/XP/Currency log buttons to PF1 sheets and opens the tracking dialog preloaded with the actor's logs.", "description": "Adds HP/XP/Currency log buttons to PF1 sheets and opens the tracking dialog preloaded with the actor's logs.",
"version": "0.1.9", "version": "0.1.10",
"authors": [ "authors": [
{ "name": "Gowler", "url": "https://foundryvtt.com" } { "name": "Gowler", "url": "https://foundryvtt.com" }
], ],