Skip to content

Commit

Permalink
version 2.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Sep 29, 2021
1 parent 62223f7 commit e20840b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 38 deletions.
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# CHANGELOG

# 2.0.12
# 2.0.12 (It should work)

- Add some performance check on the setting 'hotkeyDoorInteractionCenter','hotkeyDoorInteraction','hotkeyDoorInteractionDelay', avoid to add new listener
- Try to fix [Can "reach" further to the east](https://github.com/p4535992/foundryvtt-arms-reach/issues/28)
- Remove the old settings 'enableGridlessSupport' when click the 'e' hotkey
- Remove some comment to clean up on the next release

# 2.0.11

- Little bug fix on the socket listener
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "foundryvtt-arms-reach",
"title": "FoundryVTT Arms Reach",
"description": "Allows the GM to limit the distance that a player can interate with a placeable object like door, journal, stairway, token, ecc..",
"version": "2.0.11",
"version": "2.0.12",
"scripts": {
"package": "gulp package",
"build": "gulp build && gulp link",
Expand Down
8 changes: 4 additions & 4 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "foundryvtt-arms-reach",
"title": "FoundryVTT Arms Reach",
"description": "Allows the GM to limit the distance that a player can interate with a placeable object like door, journal, stairway, token, ecc..",
"version": "2.0.11",
"version": "2.0.12",
"author": "Psyny, p4535992",
"type": "module",
"socket": true,
Expand Down Expand Up @@ -46,9 +46,9 @@
"manifestPlusVersion": "1.2.1",
"url": "https://github.com/p4535992/foundryvtt-arms-reach",
"manifest": "https://github.com/p4535992/foundryvtt-arms-reach/releases/latest/download/module.json",
"download": "https://github.com/p4535992/foundryvtt-arms-reach/releases/download/v2.0.11/module.zip",
"readme": "https://github.com/p4535992/foundryvtt-arms-reach/blob/v2.0.11/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-arms-reach/blob/v2.0.11/changelog.md",
"download": "https://github.com/p4535992/foundryvtt-arms-reach/releases/download/v2.0.12/module.zip",
"readme": "https://github.com/p4535992/foundryvtt-arms-reach/blob/v2.0.12/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-arms-reach/blob/v2.0.12/changelog.md",
"bugs": "https://github.com/p4535992/foundryvtt-arms-reach/issues",
"allowBugReporter": true,
"dependencies": [
Expand Down
37 changes: 5 additions & 32 deletions src/module/DoorsReach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,39 +464,12 @@ export const DoorsReach = {
continue;
}

if (<boolean>getGame().settings.get(ARMS_REACH_MODULE_NAME, 'enableGridlessSupport')) {
// ==============================================================================
/*
const rd = getDistance(token, door, offsetx, offsety);
const dist = computeDistanceBetweenCoordinates(door, token);
const distInGridUnits = dist / gridSize - 0.1;

if (rd.unitDistance < shortestDistance) {
shortestDistance = rd.unitDistance;
if (rd.unitDistance <= (reach + ArmsReachVariables.grace_distance)){
closestDoor = door;
}
}
else{
iteractionFailNotification(`Door too far away: ${clampNum(rd.unitDistance)} > ${reach}`);
}
*/
// ================================================================================
const dist = computeDistanceBetweenCoordinates(door, token);
const distInGridUnits = dist / gridSize - 0.1;

if (distInGridUnits < maxDistance && dist < shortestDistance) {
closestDoor = door;
shortestDistance = dist;
}
} else {
const dist = computeDistanceBetweenCoordinates(door, token);
const distInGridUnits = dist / gridSize - 0.1;

if (distInGridUnits < maxDistance && dist < shortestDistance) {
closestDoor = door;
shortestDistance = dist;
}
if (distInGridUnits < maxDistance && dist < shortestDistance) {
closestDoor = door;
shortestDistance = dist;
}
}

Expand Down

0 comments on commit e20840b

Please sign in to comment.