Fixed backward compability issues

This commit is contained in:
Wiktor Mazur
2020-03-11 18:45:20 +01:00
parent bec7af9513
commit d1aa9e4303
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
**/target
**/*.rs.bk
**/target
damage-meter.log
backend.log
*.so
.vscode
+3 -1
View File
@@ -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
+1 -1
View File
@@ -44,7 +44,7 @@ fn python_callbacks_subscriber(event: game::Event) {
fn initialize(_py: Python) -> PyResult<u32> {
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<u32> {