Skip to content

Commit

Permalink
Area: Fix RotateArea's NewOrientation for NWN bearings
Browse files Browse the repository at this point in the history
Original math based on +90degrees being clockwise. NWN uses +90 degrees to be Anti-clockwise. Fixes the math for this..
  • Loading branch information
WilliamDraco committed Dec 3, 2023
1 parent 459d30c commit c7e0cab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ https://github.com/nwnxee/unified/compare/build8193.35.40...HEAD
### Fixed
- Experimental: PlayerHitpointsAsPercentage: added the new argument nMessageLimit to SendServerToPlayerGameObjUpdate hook
- Reveal: Fixed Reveal plugin always revealing all PCs regardless of plugin usage.
- Area: RotateArea's 'NewOrientation' corrected for NWN bearings, correcting direction of objects within the area after 90 or 270 degree rotation.

## 8193.35.40
https://github.com/nwnxee/unified/compare/build8193.35.37...build8193.35.40
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Area/Area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ NWNX_EXPORT ArgumentStack RotateArea(ArgumentStack&& args)
case 1:
{
vOrientation.x = (std::cos(std::acos(vOrientation.x) - (M_PI/2)));//less half-radian
vOrientation.y = (std::sin(std::asin(vOrientation.y) - (M_PI/2)));
vOrientation.y = (std::sin(std::asin(vOrientation.y) + (M_PI/2)));
break;
}
case 2:
Expand All @@ -1056,7 +1056,7 @@ NWNX_EXPORT ArgumentStack RotateArea(ArgumentStack&& args)
case 3:
{
vOrientation.x = (std::cos(std::acos(vOrientation.x) + (M_PI/2)));//Add half-radian
vOrientation.y = (std::sin(std::asin(vOrientation.y) + (M_PI/2)));
vOrientation.y = (std::sin(std::asin(vOrientation.y) - (M_PI/2)));
break;
}
}
Expand Down

0 comments on commit c7e0cab

Please sign in to comment.