Fixed subtle trigger bugs that break LoV hit dice extension
This commit is contained in:
@@ -1,16 +1,26 @@
|
||||
import { EngineAction } from '/imports/api/engine/action/EngineActions';
|
||||
import { applyDefaultAfterPropTasks } from '/imports/api/engine/action/functions/applyTaskGroups';
|
||||
import recalculateInlineCalculations from '/imports/api/engine/action/functions/recalculateInlineCalculations';
|
||||
import { PropTask } from '/imports/api/engine/action/tasks/Task';
|
||||
import getPropertyTitle from '/imports/api/utility/getPropertyTitle';
|
||||
|
||||
|
||||
export default async function applyTriggerProperty(
|
||||
task: PropTask, action: EngineAction, result, userInput
|
||||
): Promise<void> {
|
||||
const prop = task.prop;
|
||||
result.appendLog({
|
||||
const logContent = {
|
||||
name: getPropertyTitle(prop),
|
||||
...prop.silent && { silenced: true },
|
||||
})
|
||||
}
|
||||
|
||||
// Add the trigger description to the log
|
||||
if (prop.description?.text) {
|
||||
await recalculateInlineCalculations(prop.description, action, 'reduce', userInput);
|
||||
if (prop.description.value) {
|
||||
logContent.value = prop.description.value;
|
||||
}
|
||||
}
|
||||
|
||||
result.appendLog(logContent);
|
||||
return applyDefaultAfterPropTasks(action, prop, task.targetIds, userInput);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user