Fix self-targeted spells not casting correctly

This commit is contained in:
ThaumRystra
2025-01-25 20:51:20 +02:00
parent c42da1d492
commit b8ed9aa658
3 changed files with 8 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ export default async function applySpellProperty(
task: CastSpellTask, action: EngineAction, result: TaskResult, userInput: InputProvider
): Promise<void> {
const prop = task.prop;
const targetIds = prop.target === 'self' ? [action.creatureId] : task.targetIds;
if (!prop) {
result.appendLog({
@@ -65,7 +66,7 @@ export default async function applySpellProperty(
result.appendLog({
name: message,
silenced: prop.silent,
}, task.targetIds);
}, targetIds);
// Add the slot level to the scope
result.pushScope = {
@@ -76,6 +77,6 @@ export default async function applySpellProperty(
// Run the rest of the spell as if it were an action
return applyActionProperty({
prop,
targetIds: task.targetIds,
targetIds: targetIds,
}, action, result, userInput);
}