Skip to content

Commit 6632a46

Browse files
StartAutomatingStartAutomating
authored andcommitted
Start-OBSEffect - Fixing -LoopCount (Fixes #133)
1 parent 1bf110b commit 6632a46

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

obs-powershell.types.ps1xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ if ($this.Messages) {
16151615

16161616
$null = New-Event -SourceIdentifier "OBS.PowerShell.Effect.Ended" -MessageData $event.MessageData
16171617
$effectInfo = $event.MessageData
1618-
if ($effectInfo.LoopCount) {
1618+
if ($effectInfo.LoopCount -is [int] -and $effectInfo.LoopCount -ge 1) {
16191619
$effectInfo.LoopCount = $effectInfo.LoopCount - 1
16201620
}
16211621

@@ -1625,8 +1625,9 @@ if ($this.Messages) {
16251625
$effectInfo.Reversed = -not $effectInfo.Reversed
16261626
$effectInfo.Start()
16271627
} elseif ($effectInfo.Mode -match 'Loop') {
1628-
if (($null -eq $effectInfo.LoopCount) -or
1629-
$effectInfo.LoopCount) {
1628+
if ($effectInfo.LoopCount -is [int] -and $effectInfo.LoopCount -ge 1) {
1629+
$effectInfo.Start()
1630+
} elseif ($effectInfo.LoopCount -isnot [int] -or $effectInfo.LoopCount -lt 0) {
16301631
$effectInfo.Start()
16311632
}
16321633
} elseif ($effectInfo.Mode -match 'Bounce') {

0 commit comments

Comments
 (0)