Grimmys / rpg_tactical_fantasy_game

A tactical turn-based game project in pygame, open to support
GNU General Public License v3.0
394 stars 85 forks source link

TypeError when attempting to talk to Doran in level 2 #9

Closed talljosh closed 3 years ago

talljosh commented 3 years ago

After killing a bunch of enemies, I ran Chrisemon up to Doran and selected "talk". The program crashed with the following traceback.

I'm using Python 3.8.2, running on Ubuntu 20.04.

Traceback (most recent call last):
  File "main.py", line 53, in <module>
    quit_game = start_screen.click(e.button, e.pos)
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/StartScreen.py", line 286, in click
    self.level.click(button, pos)
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 1370, in click
    self.left_click(pos)
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 1296, in left_click
    self.interact(self.selected_player, ent, interact)
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 582, in interact
    self.ally_to_player(target)
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 478, in ally_to_player
    player = Player(character.name, character.sprite, character.hp, character.defense, character.res,
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Player.py", line 21, in __init__
    Character.__init__(self, name, (), sprite, hp, defense, res, strength, None,
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Character.py", line 22, in __init__
    Character.races_data[race]['move'] + Character.classes_data[classes[0]]['move'],
TypeError: unhashable type: 'list'
Grimmys commented 3 years ago

Thank you for the fix ! Yeah a few commits ago, max_moves was a paramater, but I changed it to be a more static value (calculated with knowledge of race and class) and it seems that I forgot to refactor the code in this function.