SelinaDev / Godot-Roguelike-Tutorial

Yet Another Roguelike Tutorial in Godot
MIT License
102 stars 11 forks source link

Bug with field of view and wait action #4

Closed ghost closed 10 months ago

ghost commented 10 months ago

Hi, i found a bug with field of view. in game.gd

        if action.perform():
            if player.grid_position != previous_player_position:
                map.update_fov(player.grid_position)

if an enemy is in a player's potential field of view, but the player uses the wait action, it will not get shown and the player will be continously attacked until they move or kill the enemy, i don't know how to fix this, So for me i just got rid of the if statement that checks if player moved and update the field of view regardless.

SelinaDev commented 10 months ago

Hi! Thank you for mentioning that! It seems that is indeed a logical error on my part. I thought that recalculating was only necessary when moving, and didn't account for the situation you described. Removing the if statement should indeed fix that problem. I will make sure to change the code (and tutorial) accordingly.

SelinaDev commented 10 months ago

Should now be solved by 71e7a8e (also updated on the website). Thanks again!

ghost commented 10 months ago

No problem, thank you for the awesome tutorial.