Skip to content

Commit

Permalink
Merge pull request #15 from 4LT/intermission-count
Browse files Browse the repository at this point in the history
Show intermission camera counts
  • Loading branch information
4LT authored Mar 8, 2024
2 parents a613e6e + bb76caa commit 7f2ff32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ fn report_payload(
let mut exit_maps: Vec<String> = Vec::new();

let qmap = parser.parse_entities()?;
let mut intermission_ct = 0i32;

for entity in qmap.entities {
let edict = entity.edict;
Expand Down Expand Up @@ -194,6 +195,8 @@ fn report_payload(
exit_maps.push("<No Map>".to_string());
}
}
} else if classname == &CString::new("info_intermission").unwrap() {
intermission_ct += 1;
}
}

Expand All @@ -218,6 +221,20 @@ fn report_payload(
}
}

let intermission_ct_str = format!("{intermission_ct}");

report_payload.insert(
"Intermission Count".to_string(),
if intermission_ct == 0 {
ReportField::Fail(
intermission_ct_str,
"No intermission cameras".to_string(),
)
} else {
ReportField::Pass(intermission_ct_str)
},
);

let filename = path.as_ref().file_name();
let filename = filename.and_then(|f| f.to_str());

Expand Down
1 change: 1 addition & 0 deletions src/pectin.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ variable ::paths {}
variable ::config {
failureOnly 0
initialDir ""
hideLineItems {}
}

proc getConfigPath {} {
Expand Down

0 comments on commit 7f2ff32

Please sign in to comment.