Skip to content

Commit

Permalink
0.0.4
Browse files Browse the repository at this point in the history
- Fixed bug related to adding a creature without an initiative value
  • Loading branch information
valentine195 committed Jun 30, 2021
1 parent aee5291 commit 6e3dfda
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-initiative-tracker",
"name": "Obsidian Initiative Tracker",
"version": "0.0.3",
"version": "0.0.4",
"minAppVersion": "0.12.5",
"description": "TTRPG Initiative Tracker for Obsidian.md",
"author": "Jeremy Valentine",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-initiative-tracker",
"version": "0.0.3",
"version": "0.0.4",
"description": "TTRPG Initiative Tracker for Obsidian.md",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class InitiativeTrackerSettings extends PluginSettingTab {
"initiative-tracker-additional-container"
);

const importSetting = new Setting(importSettingsContainer)
new Setting(importSettingsContainer)
.setName("Import Monsters")
.setDesc(
"Import monsters from monster files. Only import data that you own."
Expand Down
10 changes: 7 additions & 3 deletions src/svelte/Create.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type TrackerView from "src/view";
import { SRDMonsterSuggestionModal } from "src/utils/suggester";
import type { SRDMonster } from "@types";
import type { SRDMonster } from "@types";
const dispatch = createEventDispatcher();
Expand All @@ -36,7 +36,9 @@ import type { SRDMonster } from "@types";
dispatch("save", {
name,
hp,
initiative: initiative - modifier,
initiative:
(initiative ?? Math.floor(Math.random() * 19 + 1)) -
modifier,
ac,
modifier
});
Expand Down Expand Up @@ -71,7 +73,9 @@ import type { SRDMonster } from "@types";
ac = `${modal.creature.ac}`;
modifier = 0;
if ((<SRDMonster>modal.creature).stats) {
const dex = ((<SRDMonster>modal.creature)?.stats ?? [0, 10])[1];
const dex = ((<SRDMonster>modal.creature)?.stats ?? [
0, 10
])[1];
modifier = Math.floor((dex - 10) / 2);
}
initiative = Math.floor(Math.random() * 19 + 1) + modifier;
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"0.0.3": "0.12.4"
"0.0.4": "0.12.4"
}

0 comments on commit 6e3dfda

Please sign in to comment.