Skip to content

Commit

Permalink
fix: Fixed issue with removing 5e-based properties from monsters (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Jan 13, 2022
1 parent 8d73700 commit 64c8b1c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from "./data/constants";
import type { /* StatblockMonster, */ Monster } from "@types";
import StatblockSettingTab from "./settings/settings";
import fastCopy from "fast-copy";

import "./main.css";
import { sort } from "fast-sort";
Expand Down Expand Up @@ -244,15 +245,7 @@ export default class StatBlockPlugin extends Plugin {
data: Map<string, Monster>
): Array<[string, Monster]> {
return [...(data ?? [])].map(([name, monster]) => {
let convMonster = {
...monster,
traits: [...monster.traits],
actions: [...monster.actions],
legendary_actions: [...monster.legendary_actions],
reactions: [...monster.reactions]
};

return [name, convMonster];
return [name, fastCopy(monster)];
});
}
onunload() {
Expand Down

0 comments on commit 64c8b1c

Please sign in to comment.