elthran / RPG-Game

0 stars 1 forks source link

Cave/fighting bug. #332

Open klondikemarlen opened 6 years ago

klondikemarlen commented 6 years ago

Comment by Tester 1 (hero Odo):

Also I get an internal server error any time I try to fight monsters in the spooky cave instead of fleeing

Interpretation: Spooky Cave location code is bugged. Possibly the location problen @elthran was discussing with me.

klondikemarlen commented 6 years ago

Or possibly combat code is bugged ...

klondikemarlen commented 6 years ago

See example_monster_fight_error.txt

Most relevant passage seems to be:

2018-04-10 19:19:34,111:   File "/home/elthran/rpg_game/app.py", line 1217, in battle
2018-04-10 19:19:34,111:     battle_log = combat_simulator.battle_logic(hero, enemy) # Not sure if the combat sim should update the database or return the heros to be updated here
2018-04-10 19:19:34,112: UnboundLocalError: local variable 'enemy' referenced before assignment

Looks like this might be a scoping error? Enemy defined in 'if' .. which didn't evaluate to True. Probably a bug in the 'game.py' module which we are in the process of removing or at least implementing differently.