diff --git a/.gitignore b/.gitignore index b4a2176..9bf4fde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ **/target **/*.rs.bk **/target -damage-meter.log +backend.log *.so .vscode diff --git a/application/src/stats/damage_stats.py b/application/src/stats/damage_stats.py index aec5626..b3db33f 100644 --- a/application/src/stats/damage_stats.py +++ b/application/src/stats/damage_stats.py @@ -33,7 +33,7 @@ class Player(Stats): name: str items: dict = field(default_factory=lambda: {'weapon': None}) damage_done: float = 0.0 - combat_time: CombatTime = CombatTime() + combat_time: CombatTime = field(default_factory=lambda: CombatTime()) combat_state: CombatState = CombatState.OutOfCombat @staticmethod @@ -47,6 +47,8 @@ class Player(Stats): def update(self, other): self.name = other.name self.damage_done += other.damage_done + self.combat_state = other.combat_state + self.combat_time.entered_combat = other.combat_time.entered_combat self.combat_time.time_in_combat += other.combat_time.time_in_combat self.items = other.items diff --git a/backend/src/lib_python.rs b/backend/src/lib_python.rs index 1615ea5..3732c3c 100644 --- a/backend/src/lib_python.rs +++ b/backend/src/lib_python.rs @@ -44,7 +44,7 @@ fn python_callbacks_subscriber(event: game::Event) { fn initialize(_py: Python) -> PyResult { api::initialize(vec![ Box::new(python_callbacks_subscriber) - ]).map_or(Ok(0), |_| {Ok(2)}) + ]).map_or(Ok(2), |_| {Ok(0)}) } fn subscribe(_py: Python, callable: cpython::PyObject) -> PyResult {