Skip to content

Commit

Permalink
Fix NaN direction vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
boatbomber committed Jun 28, 2023
1 parent ff7f3d6 commit 4b455fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boatbomber/windshake",
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Settings.new(object: BasePart | Bone | ModuleScript)
objectSettings.WindPower = if typeof(WindPower) == SettingTypes.WindPower then WindPower else nil
objectSettings.WindSpeed = if typeof(WindSpeed) == SettingTypes.WindSpeed then WindSpeed else nil
objectSettings.WindDirection = if typeof(WindDirection) == SettingTypes.WindDirection
then WindDirection.Unit
then (if WindDirection.Magnitude > 0 then WindDirection.Unit else Vector3.zero)
else nil
objectSettings.PivotOffset = if object:IsA("BasePart") then object.PivotOffset else nil
objectSettings.PivotOffsetInverse = if typeof(objectSettings.PivotOffset) == "CFrame"
Expand All @@ -40,7 +40,7 @@ function Settings.new(object: BasePart | Bone | ModuleScript)
local DirectionConnection = object:GetAttributeChangedSignal("WindDirection"):Connect(function()
WindDirection = object:GetAttribute("WindDirection")
objectSettings.WindDirection = if typeof(WindDirection) == SettingTypes.WindDirection
then WindDirection.Unit
then (if WindDirection.Magnitude > 0 then WindDirection.Unit else Vector3.zero)
else nil
end)

Expand Down
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "boatbomber/windshake"
description = "High performance wind effect for leaves and foliage"
version = "2.0.1"
version = "2.0.2"
license = "MIT"
authors = ["boatbomber (https://boatbomber.com)"]
registry = "https://github.com/upliftgames/wally-index"
Expand Down

0 comments on commit 4b455fd

Please sign in to comment.