Fixed backward compability issues
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
**/target
|
**/target
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
**/target
|
**/target
|
||||||
damage-meter.log
|
backend.log
|
||||||
*.so
|
*.so
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Player(Stats):
|
|||||||
name: str
|
name: str
|
||||||
items: dict = field(default_factory=lambda: {'weapon': None})
|
items: dict = field(default_factory=lambda: {'weapon': None})
|
||||||
damage_done: float = 0.0
|
damage_done: float = 0.0
|
||||||
combat_time: CombatTime = CombatTime()
|
combat_time: CombatTime = field(default_factory=lambda: CombatTime())
|
||||||
combat_state: CombatState = CombatState.OutOfCombat
|
combat_state: CombatState = CombatState.OutOfCombat
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -47,6 +47,8 @@ class Player(Stats):
|
|||||||
def update(self, other):
|
def update(self, other):
|
||||||
self.name = other.name
|
self.name = other.name
|
||||||
self.damage_done += other.damage_done
|
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.combat_time.time_in_combat += other.combat_time.time_in_combat
|
||||||
self.items = other.items
|
self.items = other.items
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ fn python_callbacks_subscriber(event: game::Event) {
|
|||||||
fn initialize(_py: Python) -> PyResult<u32> {
|
fn initialize(_py: Python) -> PyResult<u32> {
|
||||||
api::initialize(vec![
|
api::initialize(vec![
|
||||||
Box::new(python_callbacks_subscriber)
|
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> {
|
fn subscribe(_py: Python, callable: cpython::PyObject) -> PyResult<u32> {
|
||||||
|
|||||||
Reference in New Issue
Block a user