Skip to content

Commit

Permalink
version 0.6.15
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Nov 25, 2022
1 parent 9be21a0 commit 3704b2a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.6.15

- Bug fix reorder items on inventory

### 0.6.14

- Bug fix: https://github.com/p4535992/foundryvtt-inventory-plus/issues/20
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "inventory-plus",
"title": "Inventory+",
"description": "Enhances the default dnd5e sheets inventory to allow for reorganization",
"version": "0.6.14",
"version": "0.6.15",
"main": "main.js",
"scripts": {
"publish": "gulp publish --update",
Expand Down
6 changes: 3 additions & 3 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "inventory-plus",
"title": "Inventory+",
"description": "Enhances the default dnd5e sheets inventory to allow for reorganization",
"version": "0.6.14",
"version": "0.6.15",
"authors": [
{
"name": "Felix#6196"
Expand Down Expand Up @@ -82,8 +82,8 @@
"url": "https://github.com/p4535992/foundryvtt-inventory-plus",
"manifest": "https://github.com/p4535992/foundryvtt-inventory-plus/releases/latest/download/module.json",
"download": "https://github.com/p4535992/foundryvtt-inventory-plus/releases/latest/download/module.zip",
"readme": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.14/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.14/CHANGELOG.md",
"readme": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.15/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.15/CHANGELOG.md",
"bugs": "https://github.com/p4535992/foundryvtt-inventory-plus/issues",
"allowBugReporter": true,
"relationships": {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/lib/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ function _calcItemWeight(item: Item) {
* @returns {Promise<boolean>}
* @private
*/
export async function _isFromSameActor(actor, data) {
export async function _isFromSameActor(actor:Actor, data:Item) {
//@ts-ignore
const item = await Item.implementation.fromDropData(data);
return actor.id === item.parent?.uuid || actor.uuid === item.parent?.uuid;
Expand Down
13 changes: 6 additions & 7 deletions src/scripts/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const readyHooks = async (): Promise<void> => {
const dragAndDropFromActorSource = itemCurrent.actorId ? true : false;
*/
const dragAndDropFromCompendium = itemCurrent?.uuid.includes("Compendium");
const itemDropped = await retrieveItemFromData(
const itemDropped:Item = <Item>await retrieveItemFromData(
actor,
itemCurrent.uuid,
itemCurrent.id,
Expand All @@ -122,10 +122,11 @@ export const readyHooks = async (): Promise<void> => {
);
// const dragAndDropFromActorSource = itemDropped?.actorId === actor.id ? true : false;
const dragAndDropFromActorSource = !(await _isFromSameActor(actor, itemDropped));
const itemId = itemCurrent.id;
const itemId = itemDropped.id;
let itemData: Item | null = null;
if (!itemCurrent) {
if (!itemDropped) {
// Start Patch Party Inventory
//@ts-ignore
if (itemDropped && itemDropped.type && itemDropped.id) {
itemData = <Item>itemDropped;
//@ts-ignore
Expand All @@ -144,7 +145,7 @@ export const readyHooks = async (): Promise<void> => {
return;
}
} else {
itemData = <Item>itemCurrent;
itemData = <Item>itemDropped;
}
if (!itemData) {
warn(i18n(`${CONSTANTS.MODULE_NAME}.dialogs.warn.itemdata`));
Expand All @@ -167,9 +168,7 @@ export const readyHooks = async (): Promise<void> => {
: //@ts-ignore
undefined;

const sourceActor = sourceActorId
? game.actors?.get(sourceActorId)
: undefined;
const sourceActor = sourceActorId ? game.actors?.get(sourceActorId) : undefined;

let createdItem: Item | undefined = undefined;

Expand Down

0 comments on commit 3704b2a

Please sign in to comment.