File tree Expand file tree Collapse file tree
Types/OBS.PowerShell.Effect Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ function Start-OBSEffect
104104
105105 if ($loop -or $Bounce ) {
106106 $obsEffect | Add-Member - MemberType NoteProperty Mode " $ ( if ($Bounce ) {" Bounce" }) $ ( if ($loop ) {" Loop" }) " - Force
107+ if (-not $LoopCount ) {
108+ $obsEffect | Add-Member - MemberType NoteProperty LoopCount -1 - Force
109+ }
107110 } else {
108111 $obsEffect | Add-Member - MemberType NoteProperty Mode " Once" - Force
109112 }
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ if ($this.Messages) {
8484
8585 $null = New-Event - SourceIdentifier " OBS.PowerShell.Effect.Ended" - MessageData $event.MessageData
8686 $effectInfo = $event.MessageData
87- if ($effectInfo.LoopCount ) {
87+ if ($effectInfo.LoopCount -is [ int ] -and $effectInfo .LoopCount -ge 1 ) {
8888 $effectInfo.LoopCount = $effectInfo.LoopCount - 1
8989 }
9090
@@ -94,8 +94,9 @@ if ($this.Messages) {
9494 $effectInfo.Reversed = -not $effectInfo.Reversed
9595 $effectInfo.Start ()
9696 } elseif ($effectInfo.Mode -match ' Loop' ) {
97- if (($null -eq $effectInfo.LoopCount ) -or
98- $effectInfo.LoopCount ) {
97+ if ($effectInfo.LoopCount -is [int ] -and $effectInfo.LoopCount -ge 1 ) {
98+ $effectInfo.Start ()
99+ } elseif ($effectInfo.LoopCount -isnot [int ] -or $effectInfo.LoopCount -lt 0 ) {
99100 $effectInfo.Start ()
100101 }
101102 } elseif ($effectInfo.Mode -match ' Bounce' ) {
You can’t perform that action at this time.
0 commit comments