Skip to content

Commit 970d186

Browse files
committed
Add to reset out-of-sync cameras.
1 parent cdbd4d8 commit 970d186

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

src/main.qc

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,37 @@ float() PipCmdTimers =
194194
return 1;
195195
};
196196

197+
198+
float() PipCmdReCheck =
199+
{
200+
if (camera_index == -1) {
201+
return 1;
202+
}
203+
204+
if (time < camera_start) {
205+
debug("camera start not yet reached");
206+
return 1;
207+
}
208+
209+
itemtimer_t *timer = &timers[camera_index];
210+
if (PipFindItemByEntity(timer->entnum) != nil) {
211+
debug("recheck found item");
212+
return 1;
213+
}
214+
215+
ResetCamera();
216+
SelectNextCamera();
217+
218+
return 1;
219+
}
220+
221+
197222
float() PipCmdHelp =
198223
{
199224
println("Picture-in-Picture Commands");
200-
println(" * active - Currently scheduled camera");
201-
println(" * timers - All tracked timers");
225+
println(" * active - Currently scheduled camera");
226+
println(" * timers - All tracked timers");
227+
println(" * recheck - Reset camera and try to schedule next");
202228
return 1;
203229
};
204230

@@ -213,6 +239,8 @@ float(string cmd) CSQC_ConsoleCommand =
213239
return PipCmdActive();
214240
case "timers":
215241
return PipCmdTimers();
242+
case "recheck":
243+
return PipCmdReCheck();
216244
default:
217245
return PipCmdHelp();
218246
}

0 commit comments

Comments
 (0)