AttributeError during enemy turn
Closed this issue · 1 comments
talljosh commented
During level 2, when the enemy was attacking and possibly killing one of my characters, I got this traceback:
Traceback (most recent call last):
File "main.py", line 57, in <module>
start_screen.update_state()
File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/StartScreen.py", line 112, in update_state
status = self.level.update_state()
File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 286, in update_state
self.entity_action(ent, (self.side_turn is EntityTurn.ALLIES))
File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 707, in entity_action
self.duel(ent, ent_attacked, allies, targets, ent.attack_kind)
File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 642, in duel
xp += target.xp_gain
AttributeError: 'Player' object has no attribute 'xp_gain'
Grimmys commented
Hi, this was a mistake ; xp should not be increased when the attacker is an ennemy. Thank you for the issue, I think it's fixed now.