From efdedf45a54b31c5df282541981ea899aeafcf5b Mon Sep 17 00:00:00 2001 From: hamidrezakamkari Date: Tue, 4 Feb 2020 09:28:14 +0330 Subject: [PATCH] cast unit spell changed --- world.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/world.py b/world.py index e9c4be5..25339ec 100644 --- a/world.py +++ b/world.py @@ -419,19 +419,9 @@ def get_current_turn(self): # return player.king.hp # put unit_id in path_id in position 'index' all spells of one kind have the same id - def cast_unit_spell(self, unit_id, path_id, index, spell=None, spell_id=None): + def cast_unit_spell(self, unit_id, path_id, cell, spell=None, spell_id=None): if spell is None and spell_id is None: return None - path = None - for p in self.map.paths: - if p.path_id == path_id: - path = p - break - if path is None: - return None - if index < len(path.cells): - return None - cell = path.cells[index] if spell is None: spell = self.get_spell_by_type_id(spell_id) message = Message(type="castSpell", turn=self.get_current_turn(),