Skip to content

Commit

Permalink
cast unit spell changed
Browse files Browse the repository at this point in the history
  • Loading branch information
HamidrezaKmK committed Feb 4, 2020
1 parent 76e8de9 commit efdedf4
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions world.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit efdedf4

Please sign in to comment.