Godot-Barebone-RPG
Godot-Barebone-RPG copied to clipboard
"choose_action" in "Player.gd" appends "action" to "possbile_actions" if `has_max_uses` returns true and `current_uses` is 0
https://github.com/Hairic95/Godot-Barebone-RPG/blob/62584179a14789daa44af73223730cbbc6760a00/src/entities/Player.gd#L24
This line makes no sense because if "action" answers "true" to "has_max_uses()" but "current_uses" equals "0", "else" is called and accordingly "action" is added to the "possible_actions".
Instead, the code should look like this:
var possible_actions: Array = []
for action in unit.get_actions():
if action.has_max_uses():
if action.current_uses > 0:
possible_actions.append(action)
else:
possible_actions.append(action)
Please correct me if I'm wrong - I'm just reading the code. :-D
you are definitly right, right no action implements a maximum amount of uses and I still have to implement them properly.
I'll try to fix this next time I work on the project, thanks for noticing