Pretty numbers

This commit is contained in:
Wiktor Mazur
2019-10-24 19:24:21 +02:00
parent 9a73ad9b86
commit 1d0575a6cf
7 changed files with 86 additions and 15 deletions
+5 -1
View File
@@ -116,7 +116,11 @@ pub fn stats(py: Python, stat_type: StatType) -> PyResult<PyList> {
if let Some(m) = meter.get() {
let meter = &mut *m.lock().unwrap();
return Ok(core::stats(&meter, stat_type).into_py_object(py))
return Ok(core::stats(&meter, stat_type)
.into_iter()
.filter(|s| s.damage != 0.0 || s.fame != 0.0)
.collect::<Vec<meter::PlayerStatistics>>()
.into_py_object(py))
}
Ok(PyList::new(py, Vec::<PyObject>::new().as_slice()))