Skip to content

Commit

Permalink
using client_static_s state enum to detect loading
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghugo committed Dec 4, 2022
1 parent 6c8d855 commit d7163d8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/modules/capture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,20 @@ pub unsafe fn time_passed(marker: MainThreadMarker) {

let cls_demos = &*engine::cls_demos.get(marker);
let frame_count = *engine::cls_demoframecount.get(marker);

if frame_count == 0 {
if cls_demos.demonum != -1 && cls_demos.demos[0][0] != 0 {
let cls = &*engine::cls.get(marker);

if cls.state != 5 {
// ca_dedicated=0,
// ca_disconnected=1,
// ca_connecting=2,
// ca_connected=3,
// ca_uninitialized=4,
// ca_active=5
return;
} else {
if cls_demos.demoplayback == 1 && frame_count == 0 {
// demoplayback is updated to 1 after state 4 is done
// not sure if frame 0 is that important
return;
}
}
Expand Down

0 comments on commit d7163d8

Please sign in to comment.